What is OWIN URL for ipv6 self-hosting?

My application uses the self-hosting feature of ASP.NET Web API . The name of the NuGet package I'm using is Microsoft.AspNet.WebApi.SelfHost. I used the following example as a base.

The following code works to start the host on the ipv4 localhost endpoint:

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

What should I enter if I want to specify an ipv6 address? "http: // [:: 1]: 43666" does not work. Exception thrown [reformatted]:

 System.Net.HttpListenerException: The network location cannot be reached. For information ..about network troubleshooting, see Windows Help at System.Net.HttpListener.AddAllPrefixes() at System.Net.HttpListener.Start() at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, ..Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory) at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, ..IDictionary`2 properties) 

Judging by my verification of the code in the reflector, the HttpAddUrlToUrlGroup function returned error code 1232

+7
owin self-hosting
source share
2 answers

I did not find a solution, however this is a temporary solution, although it will start the server at all addresses, including non-local and ipv4:

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

Since this question did not arouse interest, I close it

+8
source share

had the same problem, and it seemed to be the account under which the service worked. You need to make sure that it is running NetworkService - both localhost and other URL options should work then :)

0
source share

All Articles