连接' LocalSqlServer'在应用程序配置中找不到或连接字符串为空

时间:2014-06-14 11:12:35

标签: asp.net windows iis

我正在使用安装了VS2012和VS2013的Windows 8.1,我在IIS上运行我的网站但是每当我运行我的项目时,它都会在我的机器配置中出现关于LocalSqlServer连接字符串为空的错误。我在" C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Config"下看了我的机器配置。目录,发现连接字符串在那里。我差不多花了2天但是无法让我的网站在IIS上运行。感谢任何帮助?enter image description here

Server Error in '/GCC.Server' Application.

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 257:        <roleManager>
Line 258:            <providers>
Line 259:                <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 260:                <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 261:            </providers>

Source File: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config    Line: 259 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

这是完整的错误,因为我的笔记本电脑分辨率导致图片无法读取。

1 个答案:

答案 0 :(得分:0)

我开始工作并且迟到了回复。答案非常简单,我的案例问题是在IIS下。我去了IIS。选择defualt网站并点击模块。在模块下,只需删除System.Web.Security.RoleManagerModule。