applicationInitialization 在 IIS Express 中导致 500.21 错误 [英] applicationInitialization causing 500.21 error in IIS Express

查看:48
本文介绍了applicationInitialization 在 IIS Express 中导致 500.21 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能否在 web.config 中不包含此元素并在 IIS Express 中运行它?

Can I not have this element in my web.config and run it in IIS Express?

HTTP 错误 500.21 - 内部服务器错误指定的处理程序映射不正确.

HTTP Error 500.21 - Internal Server Error The specified handler mapping is incorrect.

<system.webServer>
<applicationInitialization doAppInitAfterRestart="true" skipManagedModules="false" remapManagedRequestsTo="WarmUp.html">
  <add initializationPage="/"/>
</applicationInitialization>

推荐答案

对于 IIS Express,您可以将以下属性添加到 applicationhost.config 文件(位置因 VS 版本而异)

For IIS Express you can add the following attributes to the applicationhost.config file (location differs dependent on VS version)

向应用程序池添加属性startMode

<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" startMode="AlwaysRunning" />

向应用程序添加属性preloadEnabled

<site name="WebApplication3" id="2">
                <application path="/" applicationPool="Clr4IntegratedAppPool" preloadEnabled="true" >
                    <virtualDirectory path="/" physicalPath="WebApplication3" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:59141:localhost" />
                    <binding protocol="https" bindingInformation="*:44367:localhost" />
                </bindings>
            </site>

在 web.config 中添加部分

In the web.config add the section

<system.webServer>
    <applicationInitialization remapManagedRequestsTo="Startup.htm" skipManagedModules="true" doAppInitAfterRestart="true">
      <add initializationPage="/" />
    </applicationInitialization>
  </system.webServer>

这篇关于applicationInitialization 在 IIS Express 中导致 500.21 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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