3 回答

TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超6個(gè)贊
屬性組只覆蓋所以這會(huì)為擊敗你的設(shè)置DEBUG,TRACE或任何其他。- 請(qǐng)參閱MSBuild屬性評(píng)估
此外,如果DefineConstants從命令行設(shè)置屬性,則在項(xiàng)目文件中對(duì)其執(zhí)行的操作無(wú)關(guān)緊要,因?yàn)樵撛O(shè)置將成為全局只讀。這意味著您對(duì)該值的更改將無(wú)提示失敗。
維護(hù)現(xiàn)有定義常量的示例:
<CustomConstants Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">V2</CustomConstants>
<CustomConstants Condition=" '$(TargetFrameworkVersion)' == 'v4.0' ">V4</CustomConstants>
<DefineConstants Condition=" '$(DefineConstants)' != '' And '$(CustomConstants)' != '' ">$(DefineConstants);</DefineConstants>
<DefineConstants>$(DefineConstants)$(CustomConstants)</DefineConstants>
本節(jié)必須遵循任何其他定義的常量,因?yàn)檫@些常量不太可能以相加的方式設(shè)置
我只定義了那些2,因?yàn)檫@主要是我對(duì)我的項(xiàng)目感興趣的,ymmv。
- 3 回答
- 0 關(guān)注
- 507 瀏覽
添加回答
舉報(bào)