如何确定项目是否在 MSBuild .targets 文件中以调试(或发布)模式构建,并使用此信息作为另一个属性的条件?
就像是:
<OutDir Condition="IsDebug">bin\Debug\$(SomeOtherProperty)\</OutDir>
<OutDir Condition="!IsDebug">bin\Release\$(SomeOtherProperty)\</OutDir>
是否有调试/发布模式之类的东西,或者它们只是传统的names对于不同的配置属性值集?
调试/发布或其他只是常规值Configuration
财产。
因此,只要包含/调用 .targets 文件的项目遵守约定即可;您可以按如下方式检查调试模式:
<OutDir>bin\Release\$(SomeOtherProperty)\</OutDir>
<OutDir Condition=" '$(Configuration)' == 'Debug' ">bin\Debug\$(SomeOtherProperty)\</OutDir>
或者您可以直接使用该变量:
<OutDir>bin\$(Configuration)\$(SomeOtherProperty)\</OutDir>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)