Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 943
Simone Avatar asked Nov 16 '10 08:11

Simone


1 Answers

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".

like image 181
farfareast Avatar answered Oct 08 '22 03:10

farfareast