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

VS2017 Pre-Build TF.exe checkout exited with code 3

We have a Pre-Build event which is supposed to check-out our AssemblyInfo.cs file, so that the next Pre-Build event can transform our AssemblyInfo.tt T4 Template and generate a new AssemblyInfo.cs file - this is our assembly versioning…
JTech
  • 3,420
  • 7
  • 44
  • 51
0
votes
1 answer

How to add transformed web.$configuration.config files to project

I have a web service project where I have one main web.config file and then different environment specific files as well like web.Staging.config/web.QE.config etc. Now, I am following this:…
tavier
  • 1,744
  • 4
  • 24
  • 53
0
votes
1 answer

iOS Pre-build action to change plist value based on Scheme

I have an iOS application that is using the Agentry framework to define the Agentry server URL to connect. The agentryServerURL parameter is included in a separate branding.plist file as per the SAP specs. What I am trying to do is tie my iOS…
Nate23VT
  • 423
  • 8
  • 27
0
votes
1 answer

Prebuild error when build in asp.net

I know this a similar question has asked previously, but I'm still unable to find the solution. The error I'm getting is the following: Error 2 The command "Copy…
makdu
  • 908
  • 2
  • 13
  • 26
0
votes
1 answer

How can I tell if an application is running as a post/pre-build event or standalone?

I have an application that is being run as a post-build event: Project Properties -> Build Events: call "$(TargetDir)\bin\myApp.exe" "$(ProjectPath)" However, sometimes I will run it by itself - sometimes from Visual Studio and sometimes straight…
0
votes
1 answer

How do I remove directory in Visual Studio pre-build event using conditional compiler constants?

We have various VB.NET solutions that have ClickOnce installers associated with them, but we do not require/want to keep previous builds of the installers. So what I have done today, is add a pre-build event to the projects, that deletes the…
0
votes
1 answer

project.json > scripts> precompile - use macro value in script

What I want to do: Execute some batch file in the pre-build event of a .NET core library. The batch is located in the project directory, and expects the target path as a parameter. I have found a way to do this in the context of a project.json…
0
votes
2 answers

TexTransform cli and the copyright symbol

After following the guidance found here, I've implemented a pre-build process designed to dynamical update assembly copyright. The template for the copyright is <#@ template language="C#" #> <#@ output extension=".cs" #> using System; using…
Ron O
  • 89
  • 7
0
votes
2 answers

Command line MSBUILD PreBuildEvent for bower install

I'm trying to create a command line MSBUILD publish on a Jenkins server with a PreBuildEvent to do a bower install. I already tried several options (see below) but the command line output just says build completed without executing the PreBuildSteps…
BjoVa
  • 43
  • 1
  • 3
0
votes
1 answer

Getting error while copying csdef files to target directory

I have created multiple csdef files for different environments. I wanted to copy correct csdef file to target directory using xcopy command in prebuild event. xcopy /Y "$(ProjectDir)ServiceDefinition.$(ConfigurationName).csdef" …
S2K
  • 1,185
  • 3
  • 27
  • 55
0
votes
0 answers

AnkhSVN/TortoiseSVN VS2015 Pre-Build script for auto insert Revision no longer working

I have been using AnkhSVN as my subversioning for the last year with no problems at all. I also use a build script which automatically changes the build number in the AssemblyInfo file like so. I copied AssemblyInfo.cs and renamed it as…
Gaz83
  • 2,293
  • 4
  • 32
  • 57
0
votes
1 answer

Use TargetName Macro in code

For reasons I need to read the value of the TargetName-Macro from within my code. It has to be a compile time constant. I have taken a look at Reflection.Assembly, but Reflection does not seem to help me as my module is neither the executing…
christian.s
  • 437
  • 6
  • 17
0
votes
1 answer

Pass properties from MSBuild to wix to use in the pre-build events

I'm using heat in a wix installer. At first I tried it with no properties and it worked like a charm. I added the heat command to the pre-build event and added the sourceDir declaration to the linker. Now I would like to pass properties to the wix…
Lipo
  • 75
  • 2
  • 8
0
votes
1 answer

How to add a pre-build step to project via the Visual Studio IDE

Is there an easy way to add a pre-build/post-build step to a project via the Visual Studio IDE? I know I can edit the .csproj/.*proj file - what I want to know is if there is a way right from the IDE.
shekhar
  • 1,372
  • 2
  • 16
  • 23
0
votes
1 answer

C# pre-build event doesn't appear to be expanding macro symbols?

I have a C# Project with the following line in the Pre-Build events: copy "(RSSDK_DIR)\bin\win32\libpxccpp2c.dll" "($OutDir)" /Y RSSDK_DIR is an environment variable and $OutDir is a recognized macro symbol. I am trying to copy the given DLL from…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227