Visual Studio 2013 and MSBuild command line switches

☆樱花仙子☆ 提交于 2020-01-06 02:33:27

问题


Is there a way to specify msbuild switches like /p:option=value within Visual Studio 2013?


回答1:


Formalizing my comment from above.

A possible solution may be to have a targets file (e.g. VisualStudioOverrides.targets) that defines the properties to be overridden and their values. Then, if this file exists then the csproj file will import it, thus override the relevant properties. Such an import statement should be placed at the bottom of the csproj file (after the properties to be overridden were defined) and would look something like:

<Import Project="$(MSBuildProjectDirectory)\VisualStudioOverrides.targets" Condition="Exists('$(MSBuildProjectDirectory)\VisualStudioOverrides.targets')" />


来源:https://stackoverflow.com/questions/29409111/visual-studio-2013-and-msbuild-command-line-switches

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