asp.net self host and urlacl(解决UnHandledException Message:拒绝访问的问题)

命令提示符(管理员权限)需要添加的代码:

netsh http add urlacl url=http://*:9999/ user=Everyone listen=yes

其中:

url:代码中的url(如asp.net selfhost里的WebApp.Start<Startup>("http://*:9999")代码);
user:赋予权限的用户组;

查看操作系统中已经存在的保留项:

netsh http show urlacl

删除操作系统中已存在的保留项:

netsh http delete urlacl url=http://*:9999/

相关地址:

https://stackoverflow.com/questions/16642651/self-hosted-owin-and-urlacl

原文地址:https://www.cnblogs.com/3Tai/p/9773078.html