我对此很困惑。我想在开发时使用桌面上的 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>
我在网上看到的任何东西只会让我更加困惑。任何帮助让我启动并运行?