首页 > 解决方案 > 安装 Visual Studio 2022 后,Visual Studio Code 将无法使用 dotnet core 版本 5 运行项目

问题描述

在我安装 Visual Studio 2022 并成功使用它创建 dotnet core 6 Winforms 桌面应用程序后,现有的 dotnet core 版本 5 应用程序停止从 Visual Studio Code 运行。我注意到我现在在 dotnet 的路径中有 2 个条目,第一个指向“c:\Program Files (86)\dotnet”,第二个指向“c:\Program Files\dotnet”。

当我尝试从 Visual Studio 代码编译时,出现以下错误:

    Could not execute because the application was not found or a compatible .NET SDK is not installed.
    The terminal process "MyApp.csproj', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" terminated with exit code: 2147516561.

如何让 VSC 与 dotnet 5 一起使用?[更新] 当我从 VS2022 运行 vsc 项目时,它使用 dotnet 5 运行。

标签: visual-studio-code.net-core

解决方案


推荐阅读