Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you prevent MSBuild.exe from running Build Events?

I'm building a number of projects via a script, and the occasional use of custom build events causes a great deal of difficulty for the build system. If it is possible, I'd like to invoke MSBuild.exe in such a was as to block the execution of any build events. In the long run, this is not an issue for build automation - submitters of projects with build events are forewarned that such snafuery is against the rules.

In short, is there a way to call MSBuild that will prevent the execution of any custom build steps, if present?

UPDATE:

I'd considered doing an in-place (automated) edit of the project files, but would prefer the command-line equivalent of setting "Excluded From Build" (see the Build Events options) to Yes for each of the three events.

like image 788
Sniggerfardimungus Avatar asked Nov 13 '09 21:11

Sniggerfardimungus


People also ask

What is MSBuild event?

A build event is a command that MSBuild performs at a particular stage in the build process. The pre-build event occurs before the build starts; the pre-link event occurs before the link step starts; and the post-build event occurs after the build successfully ends.

Do you need MSBuild?

msbuild is used when you want to build your project from the command line. Whenever you see a continuous integration product that will automatically build your project, it will call msbuild to perform the actual build step.

Does Visual Studio call MSBuild?

Visual Studio uses MSBuild, but MSBuild doesn't depend on Visual Studio. By invoking msbuild.exe on your project or solution file, you can orchestrate and build products in environments where Visual Studio isn't installed.

What is the difference between MSBuild and Visual Studio build?

Visual Studio determines the build order and calls into MSBuild separately (as needed), all completely under Visual Studio's control. Another difference arises when MSBuild is invoked with a solution file, MSBuild parses the solution file, creates a standard XML input file, evaluates it, and executes it as a project.


1 Answers

Pre/PostBuildEvents are properties, so to override them just set them from command line to empty string.

msbuild foo.sln /p:PreBuildEvent= /p:PostBuildEvent= 
like image 113
radical Avatar answered Oct 03 '22 23:10

radical