24

I created default .net core application using visual studio 2017 and am trying to publish it, The application works perfectly when I start it with visual studio 2017, IIS Express. But when I publish the application I get the following error: enter image description here

I use somee.com free hosting.

Could anyone help me?

Badri Neparidze
  • 309
  • 1
  • 3
  • 10

5 Answers5

30

Usually this error indicates that the ASP.NET Core Module is not installed on the server. Hosting ASP.NET Core application on IIS requires Microsoft ASP.NET Core Module. You should confirm that the module has been installed. Reference

regnauld
  • 4,046
  • 3
  • 23
  • 22
  • 5
    TLDR: Go there https://www.microsoft.com/net/download/all then select .NET Core/Runtime/TheMostRecent then download and install: Windows/Server Hosting Installer – Yepeekai Mar 23 '18 at 14:08
  • I don't know why, but in my case it was already installed and I had to repair the ASP.NET Core Module. Thank you regnauld – alex May 26 '19 at 23:06
8

Installing IIS URL Rewrite (https://www.iis.net/downloads/microsoft/url-rewrite) helped me in this case.

flam3
  • 1,897
  • 2
  • 19
  • 26
6

Reinstall .NET core or do a repair. It worked for me. This happens when you first install .NET core before IIS.

alexrait
  • 407
  • 3
  • 15
4

Installing .NET Core hosting bundle with respect to my .NET Core release version worked for me.

For .NET Core 2.2 you can visit here

Or you can select other versions here

Ashish Dehariya
  • 216
  • 3
  • 10
1

I was getting this error on Windows 10, and I had to install the Core Hosting Bundle.

Note to Microsoft: If I'm installing the SDK, maybe I need the hosting bundle too.

Source

jaycer
  • 2,941
  • 2
  • 26
  • 36