問題描述
我可能只是瞎了眼,但是有沒有命令行可以在 MSBUILD 中指定條件編譯符號?
I'm possibly just blind, but is there a command line to specify conditional compilation symbols in MSBUILD?
我的構建腳本中目前有這條線:
I currently have this Line in my buildscript:
SET MSBUILD=C:WINDOWSMicrosoft.NETFrameworkv2.0.50727MSBuild.exe
SET CONFIG=Debug
%MSBUILD% /p:Configuration=%CONFIG% /p:OutputPath=....output sourceMyProjectMyProject.csproj
我想添加一個條件.在 Visual Studio 中,我可以進入項目屬性 => 構建 => 條件編譯符號,但我沒有看到 msbuild 的選項?
And I'd like to add a condition. In Visual Studio, i can just go into Project Properties => Build => Conditional compilation symbols, but I have not seen that option for msbuild?
如果您知道我是否可以完全覆蓋 .csproj 文件中已指定的所有符號以確保只有來自我的 Buildscript 的條件進入,則獎勵 Karma.
Bonus Karma if you know if I can completely override all symbols already specified in the .csproj files to make sure that only the conditionals from my Buildscript go in.
推薦答案
你見過 這個?(大部分信息在倒數第二個帖子中)
Have you seen this? (most info is in the penultimate post)
/p:DefineConstants="MYSYMBOL1;MYSYMBOL2"
這篇關于msbuild,定義條件編譯符號的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!