本文转自:http://www.cnblogs.com/autohome7390/p/6840652.html
在windows server 2012 上安装完dotnet-win-x64.1.1.1.exe 和 DotNetCore.1.0.4_1.1.1-WindowsHosting.exe后,没有重启服务器,访问站点报以上错误,解决办法要么重启,要么执行以下两条命令:
net stop was /y
net start w3svc
https://docs.microsoft.com/en-us/aspnet/core/publishing/iis
Restart the system or execute net stop was /y followed by net start w3svc from a command prompt to pick up a change to the system PATH.