Simone
Simone

Reputation: 3996

Passing MSBuild options when calling devenv

Is there a way to pass command line switches to devenv which are then passed as-is when it calls MSBuild?

Upvotes: 10

Views: 3596

Answers (2)

farfareast
farfareast

Reputation: 2309

You definitely can achieve this for /property (/p) key of msbuild. Open .csproj in as text (with notepad.exe): all combinations like $(somename) are properties of msbuild. They can be passed in command line of msbuild via /p:somename=somevalue, but they also can be passed to devenv through environment variable. For example: start Visual Studio Command prompt, in the command prompt type:

set semename=somevalue

devenv

Visual Studio will start. Load a solution of your choice, the property "somename" will be passed to all projects in this solution with the value "somevalue".

Upvotes: 4

Julien Hoarau
Julien Hoarau

Reputation: 49990

Why don't you call MSBuild directly?

msbuild solution.sln /property:Configuration=Debug

Upvotes: -1

Related Questions