Wednesday, 21 August 2024

Hosting a .NET Core 3.1 App in an IIS Virtual Directory

Virtual Directories are useful if you wish to host multiple sites on different sub paths. Like localhost/client1website or localhost/client2website.

I was getting 500 error when trying to host a .NET 3.1 application on IIS.


Suggestions were

1) app pool - yep I had checked and checked again, it was defitely set to "No Managed Code"

2) Check the IIS Logs - see below - calling Get to [virtualdirectory1]/[virtualdirectory2] on port 80 gets me a 500

3) Check the permissions. IIS_IUSRS has read and execute permissions

4) Check that the web.config has what it should have and nothing else. - yup checked that

5) Check the application logs - Attribute 'ProcessPath' is required

At this point getting closer with the app log message. Was there something up with how I installed dotnet? Am I missing a path variable?

I found someone saying that you should really have dotnet SDK as well as the hosting package so I installed the SDK. Nope

I set the dotnet path variable to "C:\Program Files\dotnet\dotnet.exe", Nope

Then I googled ".net core 3.1 process path error".

You get a lot, but third one on Stack Overflow -- 

'Make sure you right click on your Virtual Directory and select "Convert to app".' 

I really dislike IIS more than usual today :). But hey, I made it!

Attributions

Load configuration attribute QA on Stack Overflow

No comments:

Post a Comment