我的 Web.Config 转换没有发布 - 我认为错误与我收到的这些警告有关。
使用 Visual Studio 2010,我正在玩弄我的Web.Config
/Web.Config.Debug
文件。
在我的.Debug
文件中,我多次收到以下警告。
No element in the source document matches '/configuration'
我认为它为文件中存在的每个部分列出了它。.Debug
因此,使用以下示例 Web.Config.Debug 文件 .. 将列出两次。(我猜,第一个是 for <connectionStrings>..</>
,第二个是 for <system.webServer>...</.>
)
<?xml version="1.0"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xdt:SupressWarnings="false">
<connectionStrings>
<add name="Foo" connectionString="Server=foo;Database=Foo;uid=foo;password=foo" providerName="System.Data.SqlClient"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="ETag" value="Dev_IIS" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
有人可以帮忙吗?