2016-04-22 46 views
1

似乎如果我有一个如下所示的csproj文件,我结束了BAR定义和FOO未定义。除了在csproj中现有的DefineConstants

<PropertyGroup> 
    <DefineConstants>FOO</DefineConstants> 
</PropertyGroup> 
<PropertyGroup> 
    <DefineConstants>BAR</DefineConstants> 
</PropertyGroup> 

是否有一个“定义附加常量”的语法,以便我可以使用它并以FOO和BAR定义?

我知道,在这个人为的例子,我可以有

<PropertyGroup> 
    <DefineConstants>FOO BAR</DefineConstants> 
</PropertyGroup> 

但我的实际使用情况更复杂。除了以前设置的任何东西之外,我真的需要能够定义一个常量。

回答

1

该做的:

<PropertyGroup> 
    <DefineConstants>FOO</DefineConstants> 
</PropertyGroup> 
<PropertyGroup> 
    <DefineConstants>$(DefineConstants);BAR</DefineConstants> 
</PropertyGroup> 
相关问题