Asp.net mvc 3 发布时web.config转换不工作

Asp.net mvc 3 发布时web.config转换不工作,asp.net-mvc-3,publish,web-config-transform,Asp.net Mvc 3,Publish,Web Config Transform,我有一个多项目的解决方案,转换可以在其他项目中工作,但这个项目不行。原因可能是什么 该项目是一个MVC4应用程序 解决方案的配置管理器显示,当解决方案配置处于活动状态时,它应该为项目使用活动配置 有一个Web.config、Web.Live.config、Web.Stage.config 在Web.Live.config中,我有以下代码: <?xml version="1.0" encoding="utf-8"?> <configuration xmlns:xdt="http

我有一个多项目的解决方案,转换可以在其他项目中工作,但这个项目不行。原因可能是什么

该项目是一个MVC4应用程序

解决方案的配置管理器显示,当解决方案配置处于活动状态时,它应该为项目使用活动配置

有一个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服务器,确保配置设置为活动

服务器上的web配置不包含转换


有什么想法吗?

我已经解决了这个问题,似乎在这种情况下,我必须将
xdt:Transform=“Insert”
添加到
标记中

我不知道为什么我需要考虑到转换配置文件的默认模板包含插入代码的标记,而没有这样一个可以正常工作的属性