How to deploy ASP.NET Core app in subfolder of website in IIS?

2

I want to be able to access the ASP.NET Core website with a URL such as:

https://www.test.com/myapp

The app works fine if I do not publish it in a subfolder of the IIS website. If I create a new folder (myapp) under it and publish the site there, I get this error:

HTTP Error 502.5 - Process Failure Common causes of this issue:

  • The application process failed to start
  • The application process started but then stopped
  • The application process started but failed to listen on the configured port

This is the error in the event log:

Application <app> with physical root 'C:\web\' failed to start process with commandline ' ', ErrorCode = '0x80070057 : 0.

Is it possible to run the app in a subfolder? If not, then how would I be able to run the site in a way where I can access it with the above URL?

iis
asp.net-core
subdirectory
asked on Stack Overflow May 21, 2019 by Andrew

1 Answer

3

Well I looked around quite a bit for an answer to the exact same question, figured it out for myself. So here it is for the next person: Click on 'Convert to Application' on the folder in IIS!! Assuming your .net core app is sitting in the 'myapp' folder.

enter image description here

answered on Stack Overflow Dec 15, 2019 by Matt • edited Dec 15, 2019 by Adrian Mole

User contributions licensed under CC BY-SA 3.0