代码:
HttpListener listener = new HttpListener();
错误:
System.PlatformNotSupportedException: Operation is not supported on this platform
....
In System.Net.HttpListener..ctor()
解决方法:
打开cmd命令行窗口,执行下述2个语句:
sc config http start=demand
sc start http
执行完成后,上述异常就消失了。