为什么我可以从MVC应用程序中删除ExtensionlessUrlHandler而没有任何不良影响? [英] Why can I remove ExtensionlessUrlHandler from an MVC application without any ill effects?

查看:87
本文介绍了为什么我可以从MVC应用程序中删除ExtensionlessUrlHandler而没有任何不良影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试简化MVC应用程序,并尽可能删除.有人可以向我解释下面的代码在应用程序根目录下的web.config文件中做什么.我已将其注释掉,但仍设法运行该应用程序...

I am trying to streamline my MVC application and deleting as much as possible. Can someone explain to me what this code below does in the web.config file in the root of the application. I have commented it out and still managed to run the application...

<system.webServer>

  <handlers>
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
    </handlers>
    ...

我已经看过以下问题: ASP.NET MVC 4和ExtensionlessUrlHandler 具有链接到此博客的答案:

I have looked at this question: ASP.NET MVC 4 and ExtensionlessUrlHandler which has an answer that links to this blog: http://blogs.msdn.com/b/tmarq/archive/2010/05/26/how-extensionless-urls-are-handled-by-asp-net-v4.aspx but I don't find it to explain my question.

我在开发和生产中都使用IIS 8,ASP.NET MVC 4,.NET 4.5

I am using: IIS 8, ASP.NET MVC 4, .NET 4.5 in both development and production

推荐答案

IIS express使用与IIS不同的处理程序名称

IIS express uses different handlers names than IIS

添加以下标记,并且应禁用IIS express的无扩展处理程序,仅

Add the following markup and it should disable the extensionless handlers for IIS express only

<remove name="ExtensionlessUrl-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrl-Integrated-4.0" />

这篇关于为什么我可以从MVC应用程序中删除ExtensionlessUrlHandler而没有任何不良影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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