本文介绍了在MSBUILD中,如何指定检查命令行或VS是否启动它的条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个csproj,只有在目标是从Visual Studio内而不是从MSBUILD命令行执行的情况下,才希望在Visual Studio中触发特定文件的打开.我该怎么做?
I have a csproj that I would like to have trigger the opening of a particular file in Visual Studio, only if the target was executed from within Visual Studio, but not from the MSBUILD command line. How do I do this?
推荐答案
在.* proj或.targets文件中如何使用它的示例:
Example how it could be used in your .*proj or .targets file:
<PropertyGroup>
<MyProperty Condition="'$(BuildingInsideVisualStudio)' == 'true'">This build is done by VS</MyProperty>
<MyProperty Condition="'$(BuildingInsideVisualStudio)' != 'true'">This build is done from command line of by TFS</MyProperty>
</PropertyGroup>
这篇关于在MSBUILD中,如何指定检查命令行或VS是否启动它的条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!