To host the WebAPI through kestrel, when I run web.cmd as administrator through command prompt, it runs fine. But when I run it as other user, I get the error as in the below screenshot:
UPDATE:
I for some reason had to restart the system. When I tried again it was working fine. But then came the next issue.
I had hosted the webapi on IIS with name "WoApi" under "Default Web Site". When I tried to access http://localhost/woapi/api/Aspnet_Role I got blank page.
Then I checked the stdout.log file. It had the below contents:
Hosting environment: Production
Now listening on: http://localhost:20822
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNet.Hosting.Internal.HostingEngine1
Request starting HTTP/1.1 GET http://localhost/woapi/api/Aspnet_Role
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
Request finished in 0.0187ms 404
So, then I tried with http://localhost:20822/api/Aspnet_Role and it worked.
But the port number keeps on changing every-time I restart the server. How to keep a fix address?