Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a Rest API using NET5 and I want to host it in IIS. But after created new website in IIS, it is error HTTP Error 500.30 - ASP.NET Core app failed to start[^] when I run

What I have tried:

I open logs file and see the error System.PlatformNotSupportedException[^]
Anyone have idea about it. Please advice.

Updated: I also config in IIS as picture below
https://i.stack.imgur.com/NZFQ9.png[^]
Posted
Updated 2-Mar-23 20:39pm
v2

It means that whatever version of .NET you built the project for is not installed or supported on the web server.

Talk to the tech support people at your hosting service - they can tell you what versions they support or make recommendations as to when they may be able to support your requirements.
 
Share this answer
 
Comments
huynhminh97 3-Mar-23 2:27am    
Hi @OriginalGriff, If calling API with localhost, it will run normal. This problem only occurs when I host it IIS then run website with IP and port
OriginalGriff 3-Mar-23 3:18am    
Yes, because your local computer has the right framework installed.

But the production server doesn't - so it throws an error saying just that.
Talk to the tech support / admin of your ISS host - we can't do that for you!
In addition to Griffs advice, if you are self-hosting IIS you probably need to install the ASP.NET Core Runtime 5 Hosting Bundle:
Download .NET 5.0 (Linux, macOS, and Windows)[^]

Or maybe you can try this: publish-net-core-5-0-api-to-iis[^]

Also make sure to follow the steps mentioned here:
Publish an ASP.NET Core app to IIS | Microsoft Learn[^]
 
Share this answer
 
v3
Comments
huynhminh97 3-Mar-23 2:36am    
@RickZeeland. It's unlucky, I also already installed ASP.NET Core Runtime 5 Hosting Bundle

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900