How to install dotnet core 6 webapp on IIS server window 11

Viewed 28

According to the web, I should be able to install on Windows 11 (as well as server, et al). I have an application (Hunter.API), that I can run in debug perfectly - both with Swagger as well as simply entering a Url in the browser (does an http get to a controller that returns some data from SQL Server).

Next: I published using: dotnet publish -r win-x64 - -self-contained (that's a double dash without the space between). I created a site on IIS: [IIS Mgr][1] [1]: https://i.stack.imgur.com/K47fK.png

Bindings: http localhost 80 * (wasn't sure what to put for host name; btw, I stopped the default web site that was using port 80.

Basic Settings: Sitename: HunterAPI App Pool: HunterAPI Path: down to \Hunter\Hunter.API\Bin\Release\net6.0 ??

Then I select from the right panel: Browse localhost on *.80 http and get the same that the Default Site would have produced.

Tried going to c:\Windows\System32\drivers\etc\ and opened the hosts file. Added a line 127.0.0.1 HunterAPI.com (I have no clue; some site said something like that) Restarted and no change.

Then I changed the binding port number to 8081, restarted. got 403.14 error which suggested: A default document is not configured for the requested URL, and directory browsing is not enabled on the server.

I'm lost and out of options. Any suggestions? Thanks in advance.

0 Answers
Related