Search code examples
iisasp.net-web-api.net-6.0windows-server-2012-r2

IIS 8.5, .NET 6 WebApi Controller does not work(500) while wwwroot files does


I have WebApi .Net 6 added to IIS, but controllers doesn't work.

I turned on static files to be sure if the problem in Runtimes whatever, but images work by the link, so the app is working(?). In Task Manager i can see running tasks of the app.

  1. I tried to turn on logging in web.config, no logs.

  2. I installed Serilog expecting it will write logs as i see in console, but nothing was written, i guess it's because IIS runs .dll instead of .exe.

  3. I tried manually create files on each step of the app, nothing was created....

So at this point i am stuck completely. Don't understand what the problem is.

When i run .exe of my app on the server, everything works by localhost link.

Release files created by the command: dotnet publish -c release

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

UPDATE

The problem was that i missed '/' in a file path... You can turn on app to show errors via web.config: enter image description here


Solution

  • See the answer in the main post in Update.