Windows SignalR Self-Hosting

I wrote a small POC application (console application) in C # (vs2013) which does: host and clients.

Host Side Code:

string url = "http://*:8900/"; using (WebApp.Start(url)) { Console.WriteLine("Server running at " + url); lock (just4lock) Monitor.Wait(just4lock); } 

It works only if I launched my (console) application with "Run as administrator".

Ok, now I want to move this code to my Windows Service application. When I run the same host code in a windows service, I get this error:

 An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.Owin.Hosting.dll Additional information: The server factory could not be located for the given input: Microsoft.Owin.Host.HttpListener 

My service starts as a "Local System Account". I see no way to make it "run as administrator".

Do you know a way to make SignalR self-hosting without an administrator?

How can I make this Windows service work as an administrator?

Thanks!

+7
c # windows-services signalr
source share
2 answers

Have you tried with registered source code?

 WebApp.Start<Startup>(url); 

then ...

 class Startup { public void Configuration(IAppBuilder app) { app.MapSignalR(); } } 

This is great for us ...

+12
source share

I had the same problem, and the solution for me was only to add the link to the Microsoft.Owin.Host.HttpListener assembly to my project.

+14
source share

All Articles