Home > Back-end >  Error 500: Hosting .net Core 6 app into IIS on Windows Server 2016
Error 500: Hosting .net Core 6 app into IIS on Windows Server 2016

Time:09-11

Before opening this ticket, I read dozens of other questions here on StackOverflow, youtube etc, but all suggestions that I found not solve my problem.

What I intend is to host a .net core 6 web api on windows server 2016 using IIS. I've managed to host a client site (Angular) without problems, but the API always gives me a 500.19 error:

enter image description here

I have configured port 5041, but I have already tried with others, such as 80, 8080 without success.

I already have installed the Asp.Net Core Runtime and Hosting Bundle:

enter image description here

This is my web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\EvoStats.API.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

I saw someone else who solved your problem by putting the full path of dotnet, I did that too, but it didn't solve in my case:

<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" ...

I also configured the Application Pool to not manage the code using .net CLR

enter image description here

I don't know what I can do more :(

I appreciate your help.

CodePudding user response:

I already managed to solve it.

The problem was with the access permissions to the wwwroot folder. Something strange, because I have a site (Angular) working on this folder, before giving Full Control to the user IIS_IUSRS.

enter image description here

Hope this solution helps others.

  • Related