Questions tagged [post-build-event]

An event to run scripts, macros or other custom actions after compilation.

Build events can be used to run scripts, macros, or other custom actions as a part of the compilation process.

Post-build events occur after compilation. These actions (if specified) are executed just after compilation.

How to specify build event - MSDN

511 questions
19
votes
1 answer

How can I remove tralling backslash from $(ProjectDir)?

I have a command line like this in my post-build event: aspnet_regiis -pef connectionStrings "$(ProjectDir)" -prov "DataProtectionConfigurationProvider" But aspnet_regiis is returning a failure because the tralling \ in the directory. Pass full…
Jack
  • 16,276
  • 55
  • 159
  • 284
18
votes
3 answers

TFS 2010 Build Automation and post-build event

In the project I've inherited, the original developer used a number of post-build events in his Visual Studio projects to copy around DLL's and stuff when building inside VS. This is causing some grief now that I'm trying to move these things to the…
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
17
votes
5 answers

VS Post Build Event, copy one level above solution folder?

I currently have copy "$(TargetPath)" "$(SolutionDir)Shared.Lib\$(TargetFileName)" I want to do something like this, but one level above $(SolutionDir)
bevacqua
  • 47,502
  • 56
  • 171
  • 285
16
votes
2 answers

Visual Studio - Post Build Event - Throwing Errors

I've got a nice power-shell driven post-build script that does some magic mumbo-jumbo for pulling all our plugins into the correct location after they're compiled and sorting out thier dependencies with the master-project of the solution. My problem…
Aren
  • 54,668
  • 9
  • 68
  • 101
15
votes
1 answer

"If" syntax for post-build macros in VS 2010

I'm trying to to add a post-build macro that would conditionally copy some files after the build if the configuration is not "Debug". I'm trying the following: if ('$(ConfigurationName)' <> 'Debug') copy /y…
Andrey
  • 20,487
  • 26
  • 108
  • 176
15
votes
4 answers

How to get version number in post-build event

I want to use post-build event to automatically create a nuget package and then copy it to a shared folder on our network, something like this (the version number 1.0.0.0. is specified inside the MyLib.nuspec file): nuget.exe pack…
15
votes
6 answers

Updating local nuget package on post-build event

I have my local nuget library repository separately both for my personal and work releted class libraries. I have created some of the nuget packages for the libraries which are no longer in development. I did this only for them because I do not know…
tugberk
  • 57,477
  • 67
  • 243
  • 335
15
votes
4 answers

Running Grunt from Visual Studio post build event command line

I've attempted to do this both in Visual Studio 2010 and Visual Studio 2012. If my Gruntfile.js file is in the root of my project I can run the "grunt" command from the post build event command line and it runs without a problem. grunt or…
14
votes
2 answers

Using Resource Hacker for changing the icon after the build

This question is written in several places (like here and here). In the second question there is a comment that says to use ResHacker.exe -addoverwrite "Project.exe", "Project.exe", "ProgramIcon.ico", ICONGROUP, MAINICON, 0 I also tried using…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
14
votes
2 answers

Deleting entire folder in Visual Studio Post-build event

I'm trying to delete a folder in my output directory using the following command line: del /F "$(TargetDir)Content\" Tho I always end up exiting with error code 1. I've tried several different ways, without /F, with/without slash both before and…
jsmars
  • 1,640
  • 5
  • 21
  • 33
13
votes
5 answers

How can you access the Visual Studio solution level platform from a C# project's build event?

We have a large VS 2010 solution that is mostly C# code but there are a few native DLLs that various C# projects depend upon (including our unit testing DLL). We're in the processing of trying to support both 32-bit and 64-bit versions of our…
Keith Hill
  • 194,368
  • 42
  • 353
  • 369
13
votes
5 answers

Run batch script before Debugging

I want to run a batch script every time before starting program for debugging. For the build events, such functionality is realized using pre-build event, post-build event. For actual debugging, I could not find any pre-Debug, post-Debug events. How…
Tilak
  • 30,108
  • 19
  • 83
  • 131
13
votes
5 answers

Visual Studio Post Build Event MT.exe command fails with code 9009

Hi I am running following command from my post build event: C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe -manifest "$(ProjectDir)$(TargetName).exe.manifest" -updateresource:"$(TargetDir)$(TargetName).exe;#1" It is failing with Exited…
Anand
  • 4,523
  • 10
  • 47
  • 72
12
votes
8 answers

VS Post Build Event

I would like to implement a post build event that performs the following actions A relative path copy of the DLL output (1 file, not all the debug jazz) A register the output DLL to GAC How is this done?
Michael L
  • 5,560
  • 7
  • 29
  • 32
12
votes
3 answers

How do I use msbuild in Visual Studio's post build event?

I'm trying to configure the YUICompressor.NET in my Visual Studio project. As I've understood, I have to create a .proj file and add it to my solution. After that, I need to create a post-build event that will build this .proj file and I'll get my…
Ricardo
  • 448
  • 4
  • 7
  • 19
1
2
3
34 35