Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild builds defaults to debug configuration

I am trying to use MSBuild release mode, but it always defaults to debug. Any idea why?

msbuild LP.sln /p:buildmode=release 

I checked through the following posts;

MSBuild task - Build fails because one solution being built in release instead of debug

MSBuild task configuration property

like image 628
Night Walker Avatar asked Oct 27 '09 10:10

Night Walker


People also ask

What are Debug and release build configurations?

A Debug configuration supports the debugging of an app, and a Release configuration builds a version of the app that can be deployed.

What is Debug configuration?

Visual Studio projects have separate release and debug configurations for your program. You build the debug version for debugging and the release version for the final release distribution. In debug configuration, your program compiles with full symbolic debug information and no optimization.

What is MSBuild used for?

The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software.

What is switch in MSBuild?

When you use MSBuild.exe to build a project or solution file, you can include several switches to specify various aspects of the process. Every switch is available in two forms: -switch and /switch. The documentation only shows the -switch form. Switches are not case-sensitive.


1 Answers

That depends on the contents of that buildscript. Visual Studio C# uses the parameter Configuration to switch between Release and Debug. Not buildmode. You might want to try the following:

msbuild LP.sln /p:Configuration=Release 
like image 94
Lars Truijens Avatar answered Sep 22 '22 01:09

Lars Truijens