2013-08-06 46 views
1

我沒有在我的網站上啓用rolemanager,不知何故,我收到了一個關於RoleManager的500錯誤,這非常令人困惑,我一直試圖找出如何解決這個錯誤。首次出現此錯誤時,我登錄到我的網站,然後在登錄時,我提交了我編輯表格,並出現錯誤。MVC4 500錯誤角色管理者

  • 模塊RoleManager
  • 通知AuthenticateRequest
  • 處理器ExtensionlessUrlHandler集成-4.0
  • 錯誤代碼0×00000000
  • 請求的URL http://www.mywebsite.com:80/
  • 物理路徑E:\ HostingSpaces \ MySpace的\ website.com \ wwwroot
  • 登錄用戶匿名**
  • 登錄方式匿名**

這就是500錯誤說不知何故我認爲這可能與web.config rolemanager是礦山。這是我的web.config任何有一些建議,請讓我知道我的整個網站是因爲這個。哦,這個網站在視覺開發人員中很棒。

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 

<configSections> 
<section name="resizer" type="ImageResizer.ResizerSection" requirePermission="false" /> 
</configSections> 
<connectionStrings> 
<add name="myname" connectionString="mystring" providerName="System.Data.SqlClient" /> 
</connectionStrings> 
<appSettings> 
<add key="webpages:Version" value="2.0.0.0" /> 
<add key="webpages:Enabled" value="true" /> 
<add key="PreserveLoginUrl" value="true" /> 
<add key="ClientValidationEnabled" value="true" /> 
<add key="UnobtrusiveJavaScriptEnabled" value="true" /> 
</appSettings> 

<system.web> 
<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" cookieless="false" timeout="720" /> 
<httpModules> 
    <remove name="RoleManager" /> 
    <add name="ImageResizingModule" type="ImageResizer.InterceptModule" /> 
</httpModules> 
</system.web> 

<system.webServer> 
<validation validateIntegratedModeConfiguration="false" /> 
<modules runAllManagedModulesForAllRequests="true"> 
    <add name="ImageResizingModule" type="ImageResizer.InterceptModule" /> 
</modules> 
<httpErrors errorMode="Detailed" /> 
</system.webServer> 

<runtime> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="###" /> 
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="###" /> 
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="###" /> 
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
    </dependentAssembly> 
</assemblyBinding> 
</runtime> 
<resizer> 
<plugins> 
<add name="MvcRoutingShim" /> 
</plugins> 
</resizer> 
</configuration> 

回答

1

我能解決這個問題,我不知道這是一個MVC 4問題或沒有,但如果你禁用RoleManager你必須採取另外的步驟,並在你的web.config把

<appSettings> 
    <add key="enableSimpleMembership" value="false" /> 
</appSettings>