Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying ASP NET Core to IIS

I've made a simple ASP.NET Core website based on tutorial on asp.net website here.

Now, I'd like to publish it on my other machine on the IIS.

I've followed the instructions on this site but I just can't get it working...

I keep getting 500 Internal server error

Based on the logs in Event Viewer this is the culprit:

Failed to start process with the commandline 'dotnet .\MyWebApp.dll'. Error code = '0x80004005'.

Can anyone please help me?

like image 485
evil gugl Avatar asked Jun 12 '16 18:06

evil gugl


People also ask

Can ASP.NET Core run on IIS?

NET Core Library, and the ASP.NET Core Module. The module allows ASP.NET Core apps to run behind IIS. If the Hosting Bundle is installed before IIS, the bundle installation must be repaired. Run the Hosting Bundle installer again after installing IIS.

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.


2 Answers

Had same error in a very similar situation. (New ASP.NET Core web api deployed to IIS)

Further investigation lead me to find that, in my case, 500.19 was the exact error.

Installing ASP.NET Core Module solved my problem.

reference: MVC 6 Hosted on IIS HTTP Error 500.19

like image 171
Dave Avatar answered Sep 21 '22 17:09

Dave


Returncode 500 points to a problem in starting your app.

In your publish / project folder try starting without IIS by typing:

dotnet yourapp.dll

Does this work? No: you have a problem in your project and the output should lead to your problem.

If it works properly: view "modules" in IIS Manager, is there following entry?

enter image description here

And another possibility: does your AppPoolIdentity-User has the appropriate right to access publish folder.

And you have "published"?

like image 23
Kirsten Avatar answered Sep 21 '22 17:09

Kirsten