命令提示符(管理員權限)需要添加的代碼:
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