Asp.net MVC error with configured managed modules

蓝咒 提交于 2019-12-05 22:48:44

I think you’ve got the error message because your application was relying on some other managed module (Session) and that module was configured to run only for requests to managed handler (runAllManagedModulesForAllRequests="false").

You can try the following setting to Re-configure the Session module to run for all requests

<modules>
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" />
</modules>

Ok. So I have a solution with a workaround for this. I still had to use default modules setting as:

<modules runAllManagedModulesForAllRequests="true">

But I was able to disable my custom authentication module by setting additional web.config entries for certain locations like:

<location path="~/App_Themes">
    <system.web>
        <authentication mode="None" />
    </system.web>
</location>

<location path="~/Content">
    <system.web>
        <authentication mode="None" />
    </system.web>
</location>

<location path="~/Scripts">
    <system.web>
        <authentication mode="None" />
    </system.web>
</location>

So I disabled authentication on certain paths. It's a workaround and not an actual solution. So you can still provide your own suggestions or even solutions that actually address the runAllManagedModulesForAllRequests="true" default Asp.net MVC configuration.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!