Venkata Dorisala
Venkata Dorisala

Reputation: 5075

Deploying .Net Core WebAPI project on IIS

I have created a simple web API using .Net Core and trying to publish it to IIS. But getting HTTP 500.

I followed https://docs.asp.net/en/latest/publishing/iis.html article and did exactly whatever mentioned in that.

I Installed only https://www.microsoft.com/net/download as

DotNetCore.1.0.1-WindowsHosting.exe OPT_INSTALL_REDIST=0

NOTE : I am able to deploy and access MVC application successfully but cannot access WebAPI application with the same steps.

In the IIS logs i am seeing below error.

Failed to start process with commandline '"dotnet" .\Project-1.dll', ErrorCode = '0x80070002'.

I am using the default web api template provided in Visual Studio 2015

am i missing something. Is WebAPI deployment is different to MVC app deployment w.r.t .net core ?

Upvotes: 7

Views: 5056

Answers (1)

Feasoron
Feasoron

Reputation: 3600

When you install the .NET Core Windows Server Hosting bundle, it won't restart all of the IIS processes if IIS is currently running. This is a good thing, since on a production server you wouldn't want them just to restart, but it would be nice if it was made a little clearer. First, check your System (not User) PATH variable to ensure that the path to Dotnet is there. Then, go into services and restart the Windows Process Activation Service. This will restart all of the IIS bits and get it to update the path. Once you've done this, IIS should serve up your .NET Core app just fine.

Upvotes: 6

Related Questions