我已经从 Visual Web Developer 2010 切换到 Visual Studio 2013 for Web,除了 RoleManager 不想关闭之外,一切正常。我不知道它是否是我正在使用的 LocalDB 连接字符串,但这个问题不想停止,这是我收到的错误图片
这是我的 web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<connectionStrings>
<add name="looglercontext" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=ignacio;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\ignacio.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms name=".loog" loginUrl="~/Account/login" timeout="300" protection="All" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseCookies" />
</authentication>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
<roleManager enabled="false">
<providers>
<clear />
</providers>
</roleManager>
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="720" />
<httpModules>
<remove name="RoleManager" />
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
</modules>
</system.webServer>
// runtime
</configuration>
那就是我的 web.config 请注意,这些是关键属性..
<connectionStrings>
<add name="looglercontext" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=ignacio;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\ignacio.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>
<remove name="RoleManager" />
<roleManager enabled="false">
<providers>
<clear />
</providers>
</roleManager>
这是我第一次使用 LocalDB,所以我不能 100% 确定连接字符串是否错误,数据库是 app_data 文件夹中的本地数据库,并且角色管理器代码与 VS 2010 中的相同,任何关闭的建议角色经理?