Can't find httpModules and httpHandlers inside machine.config

半世苍凉 提交于 2019-12-24 09:28:51

问题


I've read a post about httpHandlers and httpModules in ASP.NET and it said that there are such nodes (<httpModules> and <httpHandlers>) defined by default inside machine.config but when I looked they are not there. I've searched the machine.config at path "$WINDOWS$\Microsoft.NET\Framework\$VERSION$\CONFIG".

The only references are these 2 lines:

<section name="httpHandlers" type="System.Web.Configuration.HttpHandlersSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpModules" type="System.Web.Configuration.HttpModulesSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

I am using Win7, IIS7 and .NET version 4.5


回答1:


The machine configuration file, Machine.config, contains settings that apply to an entire computer. It defines such common configSections as <httpModules> and <httpHandlers> for custom modules and custom handlers so that you do not need to declare them on each website on your machine separately but directly use as

<httpModules>
   <add name="..." type="..." /> 
</httpModules>

There are no custom modules/handlers defined for an entire machine configuration and by default, the machine.config file has no <httpModules> and <httpHandlers>




回答2:


You can get a list of modules using appcmd if that's all you're trying to do. appcmd list config site/vdir -section:"system.web/httpModules"



来源:https://stackoverflow.com/questions/24056966/cant-find-httpmodules-and-httphandlers-inside-machine-config

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