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
0
votes
0 answers

VS2019 c++ solution Pre-Build Event using xcopy creating extra dll files during xcopy

I am using a Pre-Build Event in Visual Studio 2019 in my c++ solution to run xcopy in order to copy dll's and assets to the target build path. This is the xcopy cmd I'm using: xcopy /Y /D /E "$(SolutionDir)assets\*" "$(TargetDir)"
KindaSorta
  • 76
  • 4
0
votes
1 answer

How can I parse C++ code in a prebuild event?

I have a prebuild-event tool (written in Ruby) in my C++ toolchain, that generates additional C++ code from existing C++ source code. I would like to replace this tool with a faster generator and using clang would be the best option. Is there a way…
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
0
votes
1 answer

Visual Studio prebuild powershell script exiting with code 9009 and failing to build

In my project I have set pre-build event that updates content of *.cs and *.xaml files (which are included in project being built). I use Set-Content Powershell command for it. When I test it in Powershell console everything is working…
Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
0
votes
1 answer

How can I set a pre-build event in an ASP.Net MVC 2 Application in Visual Web Developer 2010 Express?

I am developing an ASP.Net MVC 2 Application in Visual Web Developer 2010 Express. I was researching about using the build configuration to copy the right web.config file for development and testing environment and found this article. But, I am not…
user529141
0
votes
2 answers

Running SPIR-V compiler as pre-build event in VS2017 if only the shader code was modified

So I've look at a few questions here which popped up after a search, but I still haven't managed to get this to work. My project has two files, main.cpp and shader.comp. The shader needs to be compiled before the main program is ran and I have a…
0
votes
1 answer

How to append build version to end of the output exe file name in console appilication with using post build event?

I have a simple console application and it has auto increment build version. When I build project, I’d like to append build version to end of the output exe file name with using post-build event. There is no macro for build version.
0
votes
2 answers

MSVC2013: How to avoid aborting build process with Pre-build script in error (error MSB3073: :VCEnd" exited with code -1)

I set a pre-build event in MSVC13 which exit with an error MSB3073: :VCEnd" exited with code -1. And I'm unable to bypass this error, i don't want the build process stop even if the bat file exit with error. I have configured the BuildEvents >…
JCV
  • 41
  • 3
0
votes
1 answer

Combine SQL files with command `copy` in a batch file introduce an incorrect syntaxe because it does add an invisible character `U+FEFF`

In a pre-build event, a batch file is executed to combine multiple SQL files into a single one. It is done using this command : COPY %@ProjectDir%\Migrations\*.sql %@ProjectDir%ContinuousDeployment\AllFilesMergedTogether.sql Everything appear to…
AXMIM
  • 2,424
  • 1
  • 20
  • 38
0
votes
0 answers

Visual Studio Pre-Build Event generates header for solution, but isn't compiled into dependent projects

I have a Visual Studio 2012 solution that contains 3 projects: A.dll, B.exe, and C.exe. Both EXEs link to the DLL, and the DLL is set as a dependency for both. The build order is A.dll, B.exe, C.exe. I have a Pre-Build Event set for A.dll: a batch…
0
votes
1 answer

Visual Studio 2015 - Pre build event to determine which projects to compile

Motivation PreBuild to disable compilation of redundant projects for faster compilation cycle. Background I have a VS15 ALL solution that contains many projects. I have a single project, PreBuild, that all the other projects are dependent on,…
idanshmu
  • 5,061
  • 6
  • 46
  • 92
0
votes
1 answer

Creating a NuGet Package that updates the MSBUILD process to run a program before the build target

I'm trying to create a NuGet package that runs an external application before build. That application creates a compilationtime.h file to know the time of compilation to show it in the About dialog box. My NuGet package has a Tools folder with the…
joseangelmt
  • 2,018
  • 18
  • 32
0
votes
2 answers

Build utility application and execute it in pre-build of another project

Scenario I want to have a solution which contains: A command-line application (Utility.exe) A class library (Library.dll) A lot of other stuff which needs to be built And I would like to build the entire solution using msbuild. Additionally, I…
helb
  • 7,609
  • 8
  • 36
  • 58
0
votes
1 answer

Visual Studio - Pre- and post-build execution locations

Is there a way to change the location of the path in which Visual Studio 2015 executes the pre- and post-build events? In my company there was a change in the Group Policy, so pre- and post-build events are resulting in the following error…
Gener4tor
  • 414
  • 3
  • 12
  • 40
0
votes
1 answer

How to resolve solution-level pre-build event macros when building the project on the build server?

I've specified a pre-build event $(SolutionDir)Tools\ResxConverter.CLI.exe android $(SolutionDir)$(SolutionName).Core\Resources\ $(ProjectDir)Resources\ This works for me locally, but the build server is failing with the…
DaveDev
  • 41,155
  • 72
  • 223
  • 385
0
votes
1 answer

Unable to execute pre-build event stored in batch file at the time of publishing WPF application

I am executing a T4 template using a pre-build event with the following script added in the Properties > Build Events > Pre-build event command line: set textTemplatingPath="%CommonProgramFiles(x86)%\Microsoft…
Ajendra Prasad
  • 299
  • 1
  • 8
  • 22