Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 643
StepUp Avatar asked Apr 19 '17 14:04

StepUp


People also ask

How do I host a .NET Core application?

In general, to deploy an ASP.NET Core app to a hosting environment: Deploy the published app to a folder on the hosting server. Set up a process manager that starts the app when requests arrive and restarts the app after it crashes or the server reboots.

Does ASP.NET Core require IIS?

The most important thing to understand about hosting ASP.NET Core is that it runs as a standalone, out of process Console application. It's not hosted inside of IIS and it doesn't need IIS to run.


2 Answers

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
like image 168
Dmitry Lyalin Avatar answered Sep 28 '22 18:09

Dmitry Lyalin


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.

like image 22
tdahman1325 Avatar answered Sep 28 '22 19:09

tdahman1325