ASP.NET MVC 5 Web.config文件:" FormsAuthenticationModule"或QUOT; FormsAuthentication" [英] ASP.NET MVC 5 Web.config: "FormsAuthenticationModule" or "FormsAuthentication"

查看:183
本文介绍了ASP.NET MVC 5 Web.config文件:" FormsAuthenticationModule"或QUOT; FormsAuthentication"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好了,所以这不是一个大问题,但它的烦我,我不能让他走了。

Ok so this not a big deal, but it's bugging me and I can't let it go.

所以我使用MVC 5.1使用.NET 4.5.1和OWIN认证。所以,当你创建一个新的MVC项目5,自动添加到Web.config以下摆脱窗体身份验证HTTP模块,因为它是用OWIN中间件时不再需要:

So I'm using MVC 5.1 with .NET 4.5.1 and OWIN authentication. So when you create a new MVC 5 project, the following is automatically added to the Web.config to get rid of the forms authentication http module because it is no longer needed when using OWIN middleware:

<system.webServer>
    <modules>
        <remove name="FormsAuthenticationModule" />
    </modules>
</system.webServer>

现在,因为我们要删除该模块,这意味着它是pviously增加$ P $,所以这里是注册在这HTTP模块进入C:\\ WINDOWS \\ Microsoft.NET \\框架\\ V4。 0.30319 \\ CONFIG \\ web.config中

Now since we are removing the module, that means it was previously added, so here is the entry registering this http module in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config:

<httpModules>
    <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
</httpModules>

这是进入C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config 对于IIS 8.5,它告诉我的应用程序使用的模块:

And here is the entry in C:\Windows\System32\inetsrv\config\applicationHost.config for IIS 8.5 that tells my application to use the module:

<system.webServer>
    <modules>
        <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" preCondition="managedHandler" />
    </modules>
</system.webServer>

那么,在应用层会自动添加到我的web配置有FormsAuthenticationModule,而在这两个服务器级别/ asp.net级配置文件中的条目使用name属性FormsAuthentication的名称属性。那么,什么是怎么回事?在我看来,该模块将不会被删除,因为name属性不匹配。我只是觉得这是一个错字,但网上搜索后,大家似乎在应用程序web.config中使用FormsAuthenticationModule。这是在asp.net / IIS的较新版本最近改变还是我失去了一些东西?

So what is automatically added to my web config at the application level has a name attribute of "FormsAuthenticationModule" while the entries in the two server level/asp.net level config files use name attribute "FormsAuthentication". So what is going on here? It seems to me that the module won't be removed since the name attribute doesn't match. I would simply think this was a typo, but after searching online, everyone seems to be using "FormsAuthenticationModule" in the application web.config. Was this a recent change in the newer version of asp.net / iis or am I missing something?

推荐答案

您说得对 - 这是在模板中一个错字

You're right -- that's a typo in the template.

这篇关于ASP.NET MVC 5 Web.config文件:&QUOT; FormsAuthenticationModule&QUOT;或QUOT; FormsAuthentication&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆