0

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:

enter image description here

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?

Nands
  • 379
  • 3
  • 19
  • It can't find your database, without more info it's impossible for anyone to help. Can you show your connection string? – DavidG Jun 02 '16 at 11:50
  • Also, please post error messages as text and not images. It's impossible to search on and images can easily disappear. – DavidG Jun 02 '16 at 11:53

0 Answers0