解析器错误消息:连接名称“LocalSqlServer”在应用程序配置中找不到或连接字符串为空
我目前正在新的 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
这是为什么?我该如何解决这个问题?谢谢!
I'm currently setting up my website on a new SQL Server 2008 server, however I'm getting the following error:
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
Why is this? And how can I resolve the issue? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如史蒂文所说,在这种情况下,您无需为此修改机器配置。
两台计算机之间肯定还有另一个不同之处导致了这种情况的发生。一对:
As Steven said, you do a in that case, no need to modify the machine config for that.
There surely is another different between both computers for that to have happened. A couple:
您的配置文件的
部分缺少连接字符串:You are missing a connection string in the
<connectionStrings>
section of you config file: