我創建與web.config中的以下變換一個新的MVC Web應用程序時變換行爲的web.config:奇怪發佈web應用
Web.Debug.config
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="Debug" value="true" xdt:Transform="Insert"/>
</appSettings>
</configuration>
Web.Release。 config
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="Release" value="true" xdt:Transform="Insert"/>
</appSettings>
</configuration>
然後我創建了一個發佈配置文件並將其命名爲Release,但我選擇了Debug(OBS!important)構建配置。
(我知道,愚蠢的例子在我的實際項目中,他們被稱爲測試和Test2的。)
當我運行發佈行動我得到的轉化Web.config中的以下內容:
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="Debug" value="true"/>
<add key="Release" value="true"/>
</appSettings>
這兩個轉換都已完成!奇怪!如果我將發佈配置文件的名稱更改爲Release2,我會得到以下正確結果:
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="Debug" value="true"/>
</appSettings>
您認爲如何?錯誤?
我已經向微軟報告過這個錯誤。 – nils