小编kro*_*oax的帖子

无法启动nancy self host而没有管理员权限

我的应用程序使用Nancy Selfhosting.当我在没有管理员权限的情况下启动它时,我得到一个System.Net.HttpListenerException"Access Denied".

这是代码:

static void Main(string[] args)
    {   
        var nancyHost = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:80/"));
        nancyHost.Start();
        Application.Run();
    }
Run Code Online (Sandbox Code Playgroud)

我也试过不同的端口但没有成功.奇怪的是,在启动侦听同一个Url的HttpListener时,我没有得到任何异常.可能导致此异常的原因是什么?

c# nancy

17
推荐指数
1
解决办法
7707
查看次数

标签 统计

c# ×1

nancy ×1