Is there a way to pass command line switches to devenv which are开发者_JS百科 then passed as-is when it calls MSBuild?
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".
Why don't you call MSBuild directly?
msbuild solution.sln /property:Configuration=Debug
精彩评论