Questions tagged [pre-build-event]

An event to run scripts, macros or other actions before 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 before compilation. These actions (if specified) are executed just before compilation.

How to specify build event - MSDN

190 questions
8
votes
3 answers

MSBuild: Deploying files that are not included in the project

I have a Pre-build event on a web project that minifies and concatenates javascript files using node. This creates a folder called BuiltScripts in the scripts folder that is a duplicate of the scripts folder except the files are minified. When I am…
Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
8
votes
1 answer

How to configure post-build events for setup/deployment projects in Visual Studio

My solution has two projects. One is my actual project and another one is setup project. My actual project has one report folder where I store my all ssrs report. I have one folder in the setup project called "SSRS_Repor". Now I want that when I…
Thomas
  • 33,544
  • 126
  • 357
  • 626
8
votes
2 answers

MSBuild Task for setting custom attribute in AssemblyInfo.cs

Is there a MSBuild task for setting custom attribute in AssemblyInfo.cs? I found AssemblyInfo task but it seems that it cannot set custom attributes, only predefined ones. I'd like to set 3 custom properties I have added into this file. Any…
Vajda
  • 1,795
  • 6
  • 39
  • 49
7
votes
3 answers

Run npm command prebuild Visual Studio 2019

I am using Visual Studio 2019 to create a new Core RazorPage application. I need to run the following commands inside my WWWRoot folder npm install npm run build I tried to add the following commands inside my pre-build script
Pacman
  • 2,183
  • 6
  • 39
  • 70
6
votes
2 answers

Pre-build event to run before any project in a solution is built

I have a little program I wrote to download all NuGet packages for a solution. I would like to setup a pre-build event that would run this program every time I build. But I need it to run before the first project starts to build. I could look at…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
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
5
votes
1 answer

How to pass the parameters to T4 templates using pre build event command line

I need to pass the parameter from my prebuild event to my T4 template. Currently i am using following Pre-build command to build my T4 template file but i am not able to pass parameter to it. "C:\Program Files (x86)\Microsoft Visual…
Vinod Kumar
  • 408
  • 4
  • 18
5
votes
1 answer

MSBuild BeforeBuild Step

I asked yesterday about getting AfterBuild working and was able to get that working by placing it at the very bottom of the Project section: MSBuild AfterBuild Step I have tried the exact same thing with a different project. This is my BeforeBuild…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
5
votes
2 answers

Auto-generating C++ code in a pre-build event using Visual Studio

I'm trying to use a pre-build event in Visual Studio (VS 2005 to be specific) to run a Python script which will automatically generate a .cpp file. The trouble I'm running into is that the compiler doesn't seem to know that this file is dirty and…
5
votes
1 answer

visual studio c# does not build files that were change by pre-build event

I have solution in visual studio 2010 c#. In the pre build event I execute command that change files in this solution. The updated file is not built in the current build. How can I do that the file, with the changes, will be built in the current…
user2717436
  • 775
  • 1
  • 10
  • 23
5
votes
0 answers

How do I force Visual Studio 2012 to run a project's pre-build events every time the project is built?

I have a pre-build event on a C# project -- when built from VS2010, this pre-build event runs on every build of the project. From VS2012, however, the pre-build event only runs when the project needs rebuilt, not on every build. Is there a way to…
5
votes
2 answers

Visual Studio pre-build event; Checking exit code for each event

I have a solution with multiple projects. One project only needs to build if both two events, in the pre-build event, exit with error code 0. So I thought I could do the following: "C:\Path\To\Binary1.exe" & "C:\path\to\binary2.exe" In my test…
Mike de Klerk
  • 11,906
  • 8
  • 54
  • 76
4
votes
1 answer

How to modify source files in Pre-Build... without modifying source files?

so I'm using Visual Studio 2005 and for my current project I'm building a C# Add-In to handle the weaving of aspects for AspectC++. It's simple enough to gather the aspect and source files and feed them into the aspect compiler, but this generates…
Oliver Watkins
4
votes
2 answers

In flutter web is there a equivalent for reactjs package.json "prebuild"

We have a single package which is built for different sites, which needs some prebuild steps to be executed before actual build steps. In flutter android, these steps are executed in "preBuild.dependsOn" (in android/app/build.gradle) Edit…
Gururaja Hegde
  • 323
  • 3
  • 9
4
votes
2 answers

How to detect debug/release in visual studio pre/post-build command line?

How can I detect Debug or Release mode from command line pre-build or post-build window? I tested the code below, it works in code text window. Can it be convert to command line code? If can, how to do it, thanks. bool debugging = false; #if DEBUG …
Nano HE
  • 1,879
  • 7
  • 28
  • 39
1
2
3
12 13