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
7
votes
1 answer

How to differentiate TFS Builds and manual builds using macros in Post build event

In TFS post build script of a .proj file I want to find whether the project build is happening through TFS triggered build or manually triggered build. Can someone suggest me how to do this using macros in Post Build event.
Sriks
  • 1,669
  • 6
  • 26
  • 40
7
votes
1 answer

How do I start a background task from a VisualStudio post-build event?

I'm trying to start an instance of grunt watch whenever a particular project is run from VisualStudio. I have a single page-app written in ember, and compiled with grunt, which connects to a backend written with WebAPI. I'm trying to reduce…
gregmac
  • 24,276
  • 10
  • 87
  • 118
7
votes
2 answers

How to create an asynchronous build event in Visual Studio (2008)?

I am trying to do a poor man integration with xUnit.Net from inside Visual Studio as a post build event. What I want is when I press Shift+F6 (Build the test project), after a successful build it should run xUnit.Console.exe and output the result in…
Jimmy Chandra
  • 6,472
  • 4
  • 26
  • 38
7
votes
3 answers

Post build step only for release build

I'm trying to setup a post-build command for CMake, which I have done using the ADD_CUSTOM_COMMAND directive as stated in the CMake documentation. What I'd like to do though, is only have the post-build run if I am creating a release build of my…
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
7
votes
1 answer

In Visual Studio 2012 (C#) How to Create Custom Macros available in Post Build

I want to add in a Post-build event commandline in my Visual Studio 2012 C# project. I have a number of projects in my solution and I would like to add to the list of macros available with "Macros>>". How can I achieve this? For instance I have the…
Sarah Weinberger
  • 15,041
  • 25
  • 83
  • 130
6
votes
1 answer

Get qmake to execute shell script after build finished on Mac

After my release build is finished I would like to run a script. I found this question How to execute shell command after compile finished from .pro in QT? but the answer doesn't work for me. I tried adding various modifications of this to my .pro…
6
votes
1 answer

Pre-Build/Post-Build Events in Visual Studio for Mac

I'm pretty new to Visual Studio, and I can't seem to find where to go to find pre and post build events. I know how to do it on Windows, but i'm on Mac currently and it seems to work differently. If anyone could help to direct me that would be…
Flarefin
  • 63
  • 1
  • 3
6
votes
1 answer

After creating Pre-build event, get error "The Exec task was not given a value for the required parameter Command"

I added some prebuild script to a Visual Studio 2017 project. powershell.exe -ExecutionPolicy ByPass -NoProfile -NonInteractive -File "./myscript.ps1" It's just a script outputting some information in console. The script executes correctly,…
Pac0
  • 21,465
  • 8
  • 65
  • 74
6
votes
2 answers

Visual Studio $(ProjectDir) is empty string

I am using Visual Studio 2017 and I want to add a post-build command. when I go to 'Macros' window I see the correct path coresponging to $(ProjectDir) variable. So I added the command: $(ProjectDir)ClientApp\npm run build but when I execute build…
Vasil Indzhev
  • 635
  • 1
  • 7
  • 17
6
votes
1 answer

How to write to text file in post build event in Visual Studio?

I am creating a Windows Service in Visual Studio. On a post build event, I'd like to have 2 files created in the bin directory called install.bat and uninstall.bat. These files should have the name of the output EXE with a /u or /i in them. The name…
Sandy
  • 1,284
  • 2
  • 14
  • 32
6
votes
1 answer

Call a method from a build event

is it possible to make a method call from a postbuild event? namespace Test { public class MyClass { public void DoSomething() { // Do something } } } Of course this class resides in a project whose…
Mefhisto1
  • 2,188
  • 7
  • 34
  • 73
6
votes
3 answers

Using compiler constants in build events

Is there anyway to use compiler constants in Build Events in Visual Studio - VB.NET? (especially in Post-Build events) Scenario If TEST_EDITION=TRUE is defined I want to run an executable during the Post-Build event so if it's FALSE then I'll run…
dr. evil
  • 26,944
  • 33
  • 131
  • 201
6
votes
2 answers

Visual Studio 2012 Post Build Events - Error Code 255

Here is my attempt to copy my application executable to another folder changing it's name: IF $(ConfigurationName) == Release ( SET DESTINATION=$(ProjectDir)Output\Distribution IF NOT EXIST "%DESTINATION%" ( MD "%DESTINATION%" ) XCOPY…
Tommaso Belluzzo
  • 23,232
  • 8
  • 74
  • 98
5
votes
1 answer

Copy Failed during post-build process

I am writing an ASP.NET web application using Visual Studio 2008. The project is mostly unchanged from the default empty project that Visual Studio provides, except for: In Properties->Build->Output, "XML documentation file" is checked and set to…
Kevin
  • 74,910
  • 12
  • 133
  • 166
5
votes
3 answers

VS .Net: Post build events for "Primary Output from " in installer project

I'm using the following post build actions in a project, to merge a lib into my application: IF $(ConfigurationName) == Debug GOTO end cp $(TargetPath) $(TargetDir)app_unmerged.exe del $(TargetPath) "C:\Program Files\Microsoft\ILMerge\ilmerge.exe"…
phatoni
  • 485
  • 1
  • 7
  • 20