Misha Levin
Misha Levin

Reputation: 23

When switched from IISExpress to IIS error in asp.net core

I am trying to run my asp.net core application (1.0 , 1.1 or 2.0) using IIS instead of IIS Express. However, when I try to do that I get the following error message:

Unable to start process c:\Program files\dotnet\dotnet.exe. The web server failed with status code 500, Internal Server Error

It does work with IIS express

P.S tried reinstalling the dotnet core and starting VS ad administrator

Upvotes: 1

Views: 425

Answers (1)

Krushnakant Ladani
Krushnakant Ladani

Reputation: 673

applicationhost.config has a lot of information in it, but the section I needed to change was under the sites tag. The physical path was set to the directory where the project was located on my other computer. I changed the path to match the path on my current computer and all worked fine. Not sure why this path isn’t relative one it exists within the solution. This is the line that I needed to change.

<virtualDirectory path="/" physicalPath="C:\Users\ericl\Source\Repos\ASP.NET Core Contacts\Contacts\src\Contacts" />

As an alternative it also works to close Visual Studio delete the whole .vs folder and reopen the project in Visual Studio. This causes the config file to regenerated with the proper values.

for more details

Upvotes: 1

Related Questions