问题描述
我正在尝试在 IIS Express 中运行 ASP.NET Core MVC 应用程序(100% 模板)。该站点似乎已托管在 IIS Express 中,但是当我在浏览器中打开该站点时,出现一般错误“无法访问此站点”。有什么想法吗?
来自 Visual Studio:
Starting IIS Express ...
Successfully registered URL "http://localhost:55516/" for site "WebApplication1" application "/"
Successfully registered URL "https://localhost:44331/" for site "WebApplication1" application "/"
Registration completed for site "WebApplication1"
IIS Express is running.
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
看看 DevTool,这是我得到的回应:
我的launchSettings.json:
{
"iisSettings": {
"windowsAuthentication": true,"anonymousAuthentication": false,"iisExpress": {
"applicationUrl": "http://localhost:55516","sslPort": 44331
}
},"profiles": {
"IIS Express": {
"commandName": "IISExpress","launchbrowser": true,"environmentvariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},"WebApplication1": {
"commandName": "Project","applicationUrl": "https://localhost:5001;http://localhost:5000","environmentvariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
编辑:有趣的是,如果我从 VS F5 就不会运行。如果我从 CLI 运行“dotnet run”,它运行得非常好......为什么???
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)