0

我目前正在新的 SQL Server 2008 服务器上设置我的网站,但是我收到以下错误:

 Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Source Error:

Line 158:        <roleManager>
Line 159:            <providers>
Line 160:                <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 161:                <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 162:            </providers>


Source File: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config    Line: 160 

为什么是这样?我该如何解决这个问题?谢谢!

4

2 回答 2

0

好吧,我以前从未在 IIS6 上这样做过,这似乎没有必要。对于初学者,如果您要在名为“LocalSqlServer”的 web.config 中添加一个 connectionString,它会与 machine.config 冲突吗?因此,您必须从机器上删除连接才能将其添加到网络。这是我作为临时修复所做的,但我以前从未在 IIS6 或 IIS7 上看到过这种设置。

正如史蒂文所说,在这种情况下,您无需为此修改机器配置。

发生这种情况的两台计算机之间肯定还有另一个不同之处。一对夫妇:

  • 您在新服务器中有一个,而不是在您的原始服务器中
  • 您正在从另一个配置继承 a。
于 2010-09-13T22:40:24.453 回答
0

<connectionStrings>您在配置文件的部分中缺少连接字符串:

<connectionStrings>
    <clear />
    <add name="LocalSqlServer" connectionString="[your connection here]" />
</connectionStrings>
于 2010-09-13T09:54:11.163 回答