【发布时间】:2011-12-21 07:42:21
【问题描述】:
我对此感到很困惑。我想在开发时使用桌面上的 SQL Server,并在发布项目时使用实时 SQL Server。我正在使用 Visual Studio 2010 中的转换工具。
当我尝试发布我的项目时,我得到“匹配定位器不存在属性‘名称’”。
我的 Web.config 文件包含:
<connectionStrings>
<add name="EFDbContext" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=db" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<sessionState mode="SQLServer" sqlConnectionString="Server=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=ASPState;Application Name=eGov" timeout="20" allowCustomSqlDatabase="true" />
</system.web>
我还在测试它,所以现在,我的 Web.Release.config 文件包含:
<connectionStrings>
<add name="EFDbContext"
connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=db"
providerName="System.Data.SqlClient"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<sessionState mode="SQLServer"
sqlConnectionString="Server=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=ASPState;Application Name=app"
timeout="20" allowCustomSqlDatabase="true"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</system.web>
我在网上看到的任何东西只会让我更加困惑。有什么帮助让我启动和运行?
【问题讨论】:
标签: visual-studio-2010 web-config-transform