0
我有一個解決方案與多個項目,變換工作在其他項目,但不是這一個。可能是什麼原因?web.config轉換在發佈時不起作用
該項目是一個MVC 4應用程序
該解決方案的配置管理器顯示,當溶液的配置是LIVE那麼就應該使用LIVE配置項目。
有一個Web.config,Web.Live.config,Web.Stage.config
在Web.Live.config我有這樣的代碼:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<compilation debug="false" xdt:Transform="SetAttributes"></compilation>
</system.web>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我將它發佈到我Web服務器,確保配置設置爲Live。
服務器上的Web配置不包含轉換。
任何想法?