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
4
votes
2 answers

Building SharpKeeper (ZooKeeper Client for .NET)

I've been looking for .NET version of the ZooKeeper client and I found one. https://github.com/ewhauser/zookeeper/tree/trunk/src/dotnet/SharpKeeper/ I was so thrilled and downloaded the source files to build a client assembly file. but when I opened…
samuel281
  • 65
  • 2
  • 6
4
votes
1 answer

Run a gradle task before resolving dependencies

I want to run a gradle task that fetches additional sources and sets them up before gradle tries to resolve dependencies. In build.gradle there is a task that fetches a sub project's source code. The task needs to be run before Gradle tries to…
Stan
  • 2,151
  • 1
  • 25
  • 33
4
votes
1 answer

'ng build' doesn't run in Visual Studio pre-build event

I have an app generated with the angular-cli that is part of a Visual Studio 2015 solution. I would like to trigger a build $(ProjectDir)_ng\ng build --prod anytime the developer builds the other projects in the solution. I know this can be done…
Mike Devenney
  • 1,758
  • 1
  • 23
  • 42
4
votes
0 answers

Creating a "PreBuildEvent" that works and can be manipulated in both MonoDevelop IDE and Visual Studio

I have a csproj file that I'm trying to build in both MonoDevelop (v5) and Visual Studio (v2015). As part of the build process, there is some source code that needs to be generated from another file before the compile. Using Prebuild-events in…
Tronman
  • 141
  • 1
4
votes
1 answer

Is there a way to modify Visual Studio 2008 or 2010 project pre-build events from within your code in C#?

Is there a way to modify Visual Studio 2008 or 2010 project pre-build events from within your code in C#? Does C# have such preprocessor directives that would allow one to configure what gets run before project compilation and build? The purpose of…
luvieere
  • 37,065
  • 18
  • 127
  • 179
4
votes
1 answer

Modify .csproj in pre-build event

tl;dr: How to modify the .csproj file during publishing with ClickOnce while executing pre-build events? Long: I'm using TFS hosted by Microsoft for version control of my solution. When publishing with ClickOnce, I get the latest revision number + 1…
Stefan Over
  • 5,851
  • 2
  • 35
  • 61
4
votes
0 answers

Alternative to Pre/Post Build Events in Visual Studio

The Pre/Post Build Events in Visual Studio has bugged me for a few years, but I just haven't got around to research a better alternative. The thing that I want to achieve is pretty much the same as I get with Post Build Events: I call a piece of…
Adrian Rosca
  • 6,922
  • 9
  • 40
  • 57
4
votes
1 answer

Computed const value constantly one build behind

While updating our build incrementer program that runs during the pre-build event, I noticed a potential problem that can cause quite a bit of issues. Building the application the first time successfully updates BuildInfo.cs and calculates all of…
Joshua
  • 8,112
  • 3
  • 35
  • 40
4
votes
1 answer

Visual Studio 2010 $(PlatformName) macro incompatible with MSBuild.exe

I have a C# project in Visual Studio 2010 with this in the pre-build event command line: echo "$(Configuration)" - "$(PlatformName)" - "$(Platform)" exit 1 and the results are: "Debug" - "AnyCPU" - "AnyCPU" even though the macro section of that…
wes
  • 1,577
  • 1
  • 14
  • 32
4
votes
2 answers

How to add source file (.cs) to resources (.resx) in a pre-build event?

Is it simple or even possible? Why: Following my other question and using this approach, now I would like to simply embed the source file to the resources so I can copy it to the temp folder while the application is running - and keep the…
mkvlrn
  • 758
  • 1
  • 8
  • 20
3
votes
3 answers

c# Generate c# code before compilation/buil (Like maven plugin in java)

I have a projet in c# .net. I need to hook the "pre build" event so I can run a c# class that will generate other c# class to the same project. I know that in java you can generate source code using maven plugin, is it possible in .net? Thanks.
SexyMF
  • 10,657
  • 33
  • 102
  • 206
3
votes
2 answers

Indirect way to reference "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\datasvcutil.exe" in a prebuild event

I am running the datasvcutil.exe command in a prebuild event. datasvcutil.exe is located in "C:\Windows\Microsoft.NET\Framework64\v4.0.30319" (on 64 bit machines.) I can just hard code this as…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
3
votes
0 answers

Can Xcode execute pre-build actions for dependency targets when building?

I have an Xcode project with an iOS app target that has a couple of dependencies on libraries that I have included as source code. Those libraries are themselves targets. One of them downloads some files that it needs at build time if they don't…
Tom Hamming
  • 10,577
  • 11
  • 71
  • 145
3
votes
1 answer

Conditional Prebuild Event Commands

Background Currently I run a pre-build command when building my solution locally. However, this command isn't needed when building on my VSTS Continuous Integration Server. Question Is there a way to only run the pre-build event commands when…
3
votes
1 answer

PreBuildEvent and PostBuildEvent on Visual Studio 2015 Tools for Apache Cordova

Does somebody know if there is a way to use PreBuildEvent and PostBuildEvent on the new Visual Studio 2015 Tools for Apache Cordova? I tried this post, but it didn't work: Setting post-build event commands?
1 2
3
12 13