9

In a WEB API 2 OWIN self host project I get "Access is denied" exception thrown for anything other then localhost in:

string baseUrl = http://localhost:2500;
WebApp.Start<Startup>(baseUrl);

If I use 127.0.0.1 or an actual IP address of the machine I get this exception. No one ever mentions this problem in their blogs about self hosted web api 2 owin based.

What is the problem here and how do I solve it?

I have found this Self hosted OWIN and urlacl but I get the same exception throw.

Community
  • 1
  • 1
elector
  • 151
  • 1
  • 6

1 Answers1

6

This worked for me

What URL does OWIN understand for ipv6 self-hosting?

WebApp.Start<Startup>("http://+:43666");

I still think this should be mentioned and discussed in the WEB API 2 OWIN tutorials!

Community
  • 1
  • 1
elector
  • 151
  • 1
  • 6
  • Relevant link: [Running self-hosted OWIN Web API under non-admin account](http://stackoverflow.com/questions/24976425/running-self-hosted-owin-web-api-under-non-admin-account) – Absolom Aug 29 '16 at 19:13
  • The real secret here is to use the "+" . For some unknown reason Windows will accept a binding with "+" wildcard but not if you specify a url or ip – Lineker Aug 29 '16 at 20:30