Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Post Build Event

I would like to implement a post build event that performs the following actions

  1. A relative path copy of the DLL output (1 file, not all the debug jazz)
  2. A register the output DLL to GAC

How is this done?

like image 282
Michael L Avatar asked Dec 16 '08 13:12

Michael L


1 Answers

Enter following into "Project properties->Build events->Post build events command line:"

xcopy "$(TargetPath)" "target path" /Y && regasm "$(TargetPath)"

or add following snippet to project (e.g. csproj) file

<PropertyGroup>
    <PostBuildEvent>xcopy "$(TargetPath)" "target path" /Y && regasm "$(TargetPath)"</PostBuildEvent>
</PropertyGroup>

Note that it is recommended to add "" around copy command arguments to avoid problems with paths containing whitespaces. Also note that multiple commands can be combined using &&

like image 94
aku Avatar answered Nov 08 '22 13:11

aku