Handler “aspNetCore” has a bad module “AspNetCoreModuleV2” in its module list

前端 未结 12 1512
遇见更好的自我
遇见更好的自我 2020-12-29 19:32

I used angular .net core 2.2 template to build application.In localhost working fine,When i host to IIS Im getting this error.Im using IIS 10 to host the application.

<
相关标签:
12条回答
  • 2020-12-29 19:44

    Install .Net Core 2.2 run-time bundle on hosting machine.

    Or

    Publish your project as self-contained.

    0 讨论(0)
  • 2020-12-29 19:47

    I had this problem just a second ago. I replaced my code part in web.config with this.

    OLD PART:

    <handlers>
            <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" 
            resourceType="Unspecified" />
    </handlers>
    

    NEW PART:

    <handlers>
            <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" 
            resourceType="Unspecified" />
    </handlers>
    
    0 讨论(0)
  • 2020-12-29 19:51

    There are a couple ways you can fix this:

    1. Install the latest .NET Core Runtime
    2. Inspect the applicationhost.config file used by your IIS. You should have the following entry in its appropriate locations:
    <configuration>
        <system.webServer>
            ...
            <globalModules>
                ...
                <add name="AspNetCoreModuleV2" image="%IIS_BIN%\Asp.Net Core Module\V2\aspnetcorev2.dll" />
            </globalModules>
        </system.webServer>
        ...
        <location path="" overrideMode="Allow">
            <system.webServer>
                <modules>
                    ...
                    <add name="AspNetCoreModuleV2" lockItem="true" />
                </modules>
            </system.webServer>
        </location>
    </configuration>
    

    Just make sure you actually have the file for aspnetcorev2.dll in your IIS bin directory.

    0 讨论(0)
  • 2020-12-29 19:53

    Here is what worked for me:

    1. Check your applicationhost.config file and ensure you have the following entry in your globalModules section.

    <add name="AspNetCoreModuleV2" image="%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll" />

    1. Open IIS Manager, go to Modules. If AspNetCoreModuleV2 is not listed, click "Configure Native Modules..." and select "AspNetCoreModuleV2" and click OK to enable it.
    0 讨论(0)
  • 2020-12-29 19:56

    Windows IIS

    Solution: Install the hosting bundle.

    Reason: Although the SDK normally contains the runtime, however, it seems the SDK installer is not registering the runtime correctly on the server.

    Workaround (not recommended):

    Change AspNetCoreModuleV2 to AspNetCoreModule inside web.config.

    Azure platform hosting

    Install the .NET Core runtime extension by selecting Extensions and then installing .NET Core Runtime.

    0 讨论(0)
  • 2020-12-29 19:56

    ASP.NET Core 2.2 or later: For a 64-bit (x64) self-contained deployment that uses the in-process hosting model, disable the app pool for 32-bit (x86) processes.

    In the Actions sidebar of IIS Manager > Application Pools, select Set Application Pool Defaults or Advanced Settings. Locate Enable 32-Bit Applications and set the value to False.

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.0#create-the-iis-site

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