The ASPNETCoreModule which is required to host .NET Core projects in IIS does not appear to be installed

25,830

Solution 1

I got this error in Visual Studio 2019 and my solution was to run the VS installer and verify that the ASP.NET workload was installed. In my case it was not, simply installing it resolved the issue.

Exact steps to take if you want to follow my solution:

  • Open VS installer
  • Click MODIFY on the SKU of VS you were trying to use when you got the error (in my case the Preview version of VS enterprise)
  • In the list of workloads make sure ASP.NET is checked, if not check it and click install

Solution 2

This happened for me with an update to VS 2019. What I did was:

  1. Open Visual Studio Installer.
  2. Click Modify
  3. Click "Development time IIS support" under ".NET cross-platform development"
  4. Click Modify

This fixed the issue for me.

Solution 3

What worked for me is installing .NET Core hosting bundle from here:

http://download.microsoft.com/download/3/8/1/381CBBF3-36DA-4983-BFF3-5881548A70BE/DotNetCore.1.0.4_1.1.1-WindowsHosting.exe

Update:

Last available version can be found here

Just install it and start your project using IIS.

Solution 4

check IIS Express on Vs2017 installer

enter image description here

Solution 5

Since it's unclear if you are trying to host them in IIS or not (this message should only appear when you try to host it on IIS)... a shoot into the blue.

The ASPNetCoreModule isn't installed by default iirc, not even with VS2015/2017 tools. You can download and install them from the official .NET Core download page here.

You need the "Windows Server Hosting (x64 & x86)".

Share:
25,830
StepUp
Author by

StepUp

Love learning, coding and do new tries. Open to know new knowledge:). Like developing software. Are you looking for a typical code sample? Please download all in one code framework ! It is really cool to find new knowledges and share with you!:) Explore the .NET Framework source code online!:) Bandy lover!:)

Updated on July 19, 2022

Comments

  • StepUp
    StepUp almost 2 years

    I've just installed Visual Studio 2015 and have just created new ASP.NET Core Web Application project. When I run the ASP.NET Core Web application project I've met the following exception(I am just hitting Ctrl+F5 to run the project in Visual Studio 2015):

    The ASPNETCoreModule which is required to host .NET Core projects in IIS does not appear to be installed. Try repairing Visual Studio to correct the problem.

    If I run other types of projects such as ASP.NET MVC or ASP.NET Web API, then they run perfectly.

    The following SDK is already installed:

    enter image description here

    My project.json file:

    {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.1",
          "type": "platform"
        },
        "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0",
        "Microsoft.AspNetCore.Mvc": "1.0.1",
        "Microsoft.AspNetCore.Razor.Tools": {
          "version": "1.0.0-preview2-final",
          "type": "build"
        },
        "Microsoft.AspNetCore.Routing": "1.0.1",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
        "Microsoft.Extensions.Configuration.Json": "1.0.0",
        "Microsoft.Extensions.Logging": "1.0.0",
        "Microsoft.Extensions.Logging.Console": "1.0.0",
        "Microsoft.Extensions.Logging.Debug": "1.0.0",
        "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
      },
    
      "tools": {
        "BundlerMinifier.Core": "2.0.238",
        "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
      },
    
      "frameworks": {
        "netcoreapp1.0": {
          "imports": [
            "dotnet5.6",
            "portable-net45+win8"
          ]
        }
      },
    

    What I've tried to do:

    1. I have varied version attribute to 1.0.0-preview2-final, 1.0.1, 1.0.3 :

      "Microsoft.NETCore.App": { "version": "1.0.3",//1. "type": "platform" },

    2. I have installed DotNetCore.1.0.4_1.1.1-WindowsHosting:

    enter image description here

    1. I have repaired Visual Studio 2015 Professional twice.

    Does anybody know what I should do to fix the problem? Any help would be greatly apreciated

    • Tseng
      Tseng about 7 years
      You trying to run it in IIS?
    • StepUp
      StepUp about 7 years
      @Tseng I am just hitting Ctrl+F5 to run the project
    • Tseng
      Tseng about 7 years
      And you are really using ASP.NET Core 1.0 and not 1.1 (see dependency section of project.json)? Microsoft.NETCore.App is a meta package for most runtime related libraries (usually most common System.* assemblies) and tells which version of the runtime to use. If you use ASP.NET Core 1.1 you also need a .NET Core 1.1.x runtime (1.1.0 or 1.1.1 iirc)
    • StepUp
      StepUp about 7 years
      I've attached my package.json file to the question to avoid misunderstandings. Thanks in advance.
    • Dnyaneshwar Suryawanshi
      Dnyaneshwar Suryawanshi almost 4 years
      Same issue I got and made simple changes in my Project. 1]Go to Project properties and click on debug tab. 2]Now select IIS from Launch and save 3]Build the project and run.
  • StepUp
    StepUp about 7 years
    I am not hosting my application at IIS, what I do is I am trying to run the ASP.NET Core project locally at my PC from Visual Studio 2015.
  • StepUp
    StepUp about 7 years
    Please, see my question again, I've attached an image about what SDK are installed. Shoud I install "Windows Server Hosting (x64 & x86)"?
  • StepUp
    StepUp about 7 years
    Please, see my question again, I've attached an image about what SDK are installed. Shoud I install "Windows Server Hosting (x64 & x86)"?
  • Alexandre Nourissier
    Alexandre Nourissier about 7 years
    It can't hurt to try. I'm sure I had this message before and it was a version mismatch between the project structure (xproj, project.json or csproj) and the tooling I had. By default it will take the latest tooling.
  • StepUp
    StepUp about 7 years
    So I need to change version from "version": "1.0.0-preview2-003131" to "version": "1.0.3-preview2-003131" ?
  • Alexandre Nourissier
    Alexandre Nourissier about 7 years
    Go here "C:\Program Files\dotnet\sdk" on your disk to see the versions you have
  • StepUp
    StepUp about 7 years
    I've installed this package (.NET Core 1.1.1 runtime (Current)). However, there is still the same error. May be another suggestions?
  • Tseng
    Tseng about 7 years
    The error message is not about the runtime, it's about the IIS module. ASPNETCoreModule is a specialized fork of HttpPlattformHandler (an IIS Module for Http Listener and proxy requests). This is not part of the runtime. It should normally be installed with a) .NET Tools for Visual Studio 2015 (or with VS2017 installer since .NET is built-in) or via the ""Windows Server Hosting (x64 & x86)" download on the .NET Core download page, not ".NET Core 1.1.1 runtime (Current)"
  • Tseng
    Tseng about 7 years
    Normally "Windows Server Hosting (x64 & x86)" is for Server usage, where you only install runtime + the module, w/o the VS2015 tools (you typically don't have VS2017 running on your webserver :P)
  • StepUp
    StepUp about 7 years
    I've already installed the following software DotNetCore.1.0.4_1.1.1-WindowsHosting, however I still get the same error The ASPNETCoreModule which is required to host .NET Core projects in IIS does not appear to be installed. Try repairing Visual Studio to correct the problem. In addition, I've tried to repair my Visual Studio 2015. Please, may be you have another suggestions?
  • Tseng
    Tseng about 7 years
    Not really... Switch to VS2017. It installs and updates faster and will be the only one which support future versions of the dotnet tools/build pipeline. The old project.json related tools won't be updated anymore, they are deprecated. So it's unavoidable to switch to vs2017 at some point
  • StepUp
    StepUp about 7 years
    please, see my question again. I've attached the image about what I've installed that you gave me advice. Is it correct?
  • StepUp
    StepUp about 7 years
    I've changed this parameter. Nothing happened. I still get the same error.
  • StepUp
    StepUp about 7 years
  • Alexandre Nourissier
    Alexandre Nourissier about 7 years
    Then I guess this is a dead end, maybe the ASPNetCoreModule is actually missing. Don't forget to post your solution once you solved it.
  • Demodave
    Demodave over 2 years
    Can you give more details? What is SKU and where is the list of workloads?