MSBUILDEMITSOLUTION not working with .NET 4?

天大地大妈咪最大 提交于 2019-12-17 10:59:29

问题


In prior versions of MSBuild, you could set an environment variable named MSBUILDEMITSOLUTION to 1 to get an XML version of a solution (.sln) file that could be parsed. According to the MSBuild Team Blog, that's still in the version that ships with Visual Studio 2010, but it does not seem to be working.

Has anyone managed to get this working with MSBuild 4.0? If so, what is required?

(We use this to find and run convention-based unit tests with an NAnt script.)


回答1:


Set MSBuildEmitSolution=1 and then build from the command line. You should then see a MySolution.sln.metaproj file near MySolution.sln.

Notes:

  • If you open a command prompt window, then set the env var via System Settings, you will have to open a new command prompt.
  • You'd think you could also use msbuild /p:MSBuildEmitSolution=1, but you can't.


来源:https://stackoverflow.com/questions/3887263/msbuildemitsolution-not-working-with-net-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!