尝试确定托管您的 application.A 任务的 dotnet.exe 的进程 ID 时发生错误,已取消

An error occurred attempting to determine the process id of dotnet.exe which is hosting your application.A task was canceled

当我尝试使用 IIS Express 启动我的项目时,出现错误:

enter image description here

对比 2017

  • 项目属性
  • 调试
  • 启动浏览器//http://localhost:5000 或其他
  • 取消选中启用 SSL
  • App Url //http://localhost:5000 或其他。确保与 Launch Browser url
  • 相同
  • 保存并关闭
  • 在属性(解决方案资源管理器)下打开 launchsettings.Json
  • 确保删除旧设置。如果没有就删除。
  • 保存并关闭。

希望对你有帮助

我在尝试启动目标框架版本与我环境中安装的版本不同的下载项目时遇到此错误。我在文本编辑器中打开“.csproj”文件,在“TargetFramework”节点中更正版本并保存修改后的文件。为了确保更改生效,我关闭并重新打开包含该项目的 Visual Studio 解决方案。然后项目就正确启动了。