c# - MSBuild called by Process.Start() behaving differently between VS2010 and VS2013? -


i have both vs2010 , vs2013 installed , trying run program compiles .net 4.0 solution calling msbuild (c:\windows\microsoft.net\framework64\v4.0.30319).

for record, code looks like:

var processstartinfo = new processstartinfo             {                 filename = pathtomsbuild,                 arguments = "c:\path\to\mysolution.sln /nr:false",                 createnowindow = true,                 useshellexecute = false             };             var process = process.start(processstartinfo);             process.waitforexit(); 

i've checked .sln, contains .vcxproj , .csproj file, , these contain references toolsversion=4.0.

when execute program in vs2010 (or open cmd.exe , run msbuild command myself) works fine , compiles solution. however, when run same program using vs2013 following error msbuild:

c:\program files (x86)\msbuild\microsoft\visualstudio\v12.0\codeanalysis\micros oft.codeanalysis.targets(214,5): error msb4175: task factory "codetaskfacto ry" not loaded assembly "c:\windows\microsoft.net\framework64 \v4.0.30319\microsoft.build.tasks.v12.0.dll". not load file or assembly ' file:///c:\windows\microsoft.net\framework64\v4.0.30319\microsoft.build.tasks.v 12.0.dll' or 1 of dependencies. system cannot find file specified . [c:\...\solution\myproject.vcxproj] 

i found this answer on msdn solved me - after commenting out offending lines file, can call msbuild succesfully vs2013. don't understand why relevant since thought running v4.0 msbuild compile project toolsversion=4.0.

presumably due environment variable getting set when run/debug program vs2013? can't find details on internet. please explain going on here?

you try adding /v:diag switch arguments. cause msbuild run output verbosity set diagnostic. show state of env vars , app domain @ start of each call , might identify differences.

note - take out when you're done slow down build process.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -