ASP.NET IIS 7.5 HTTP 500.21 error

后端 未结 4 864
深忆病人
深忆病人 2021-02-04 01:59

I am having an issue setting up a local site.

The project is using ASP.NET Framework 4.0 and I have my DefaultAppPool to use 4.0 with Managed Pipeline Mode as Integrated

相关标签:
4条回答
  • 2021-02-04 02:37

    I am guessing that based on your .NET version that you're on Windows 7.

    According to .NET 4.0 Versions and Dependencies:

    (.NET 4.0) Not installed as part of the Windows operating system, but can be installed separately on Windows XP, Windows Server 2003, and later versions of Windows.

    Follow this link for an installer of .NET 4.0

    After installing you may have to do additional config. See this blog post.

    Excerpts from the blog post in case of link loss:

    After installing .NET Framework 4.0 on a machine there is a few configuration changes you need to do to IIS in order to get a ASP.NET 4.0 page running:

    First set the Application pool to run in ASP.NET v4.0 “mode”.

    Then you need to allow ASP.NET v4.0.x to run. This is done in the ISAPI and CGI Restrictions found on the server level.

    (Go to Administrative Tools > Internet Info Services Manager > Click on the Server. Then Open ISAPI and CGI Restrictions > Find ASP.NET V4.0.XXX make sure the restriction is set to Allowed. If set to Not Allowed, double click it, and check the Allow extension path to execute. Hit OK.)

    Note: Depending on order of installation you may also have to run aspnet_regiis.exe -i from the command line to "re-install" ASP.NET on IIS.

    Instructions for configuring ISAPI and CGI restrictions for IIS 7.5 on various Windows flavors.

    0 讨论(0)
  • 2021-02-04 02:43

    You must register IIS to framework 4 to execute it correctly. You must follow the start menu as given below to get VS(installed version) command prompt Start->All Programs -> Microsoft Visual Studio (installed version)->Visual Studio Tools -> Visual Studio Command Prompt(installed version)

    For details try below link : https://forums.asp.net/t/1587832.aspx?Problem+with+ExecuteRequestHandler+in+iis7

    0 讨论(0)
  • 2021-02-04 02:44

    Did you register .NET with IIS? If not run the following commands:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
    

    You need to do this from an elevated command prompt (...run as admin).

    0 讨论(0)
  • 2021-02-04 02:55

    I was facing the same issue. When i checked at App pool.NET framework version it was v2.0. My application was with 4.0 compatible. I ran below commands which has fixed the issue and now I am able to get my web services

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
    

    However after running those commands the default .NET framwork also changed to v4.0

    0 讨论(0)
提交回复
热议问题