WEB API 2, Selfhost, Access is denied for everything but "localhost"
Asked Answered
H

1

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.

Hedgerow answered 11/1, 2015 at 10:2 Comment(1)
Do you succeed, if you try it as admin?Perhaps
H
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!

Hedgerow answered 11/1, 2015 at 16:19 Comment(2)
Relevant link: Running self-hosted OWIN Web API under non-admin accountBubb
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 ipEvaporate

© 2022 - 2024 — McMap. All rights reserved.