【发布时间】:2014-02-06 00:06:54
【问题描述】:
我在 C# (vs2013) 上编写了一个小型 POC 应用程序(控制台应用程序),它构成:主机和客户端。
主机端代码:
string url = "http://*:8900/";
using (WebApp.Start(url))
{
Console.WriteLine("Server running at " + url);
lock (just4lock)
Monitor.Wait(just4lock);
}
只有当我使用“以管理员身份运行”运行我的(控制台)应用程序时它才有效。
好的,现在我想将此代码移至我的 Windows 服务应用程序。当我在 Windows 服务上运行相同的主机代码时,出现此错误:
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
我的服务作为“本地系统帐户”运行。我没有看到任何使其“以管理员身份运行”的选项。
您知道在没有管理员的情况下让 SignalR 自托管工作的方法吗?
我怎样才能让这个windows服务以管理员身份运行?
谢谢!
【问题讨论】:
标签: c# windows-services signalr