visual-studio-code - 安装 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 运行。
解决方案
推荐阅读
- c# - Entity Framework Core 3.0 使用 DbSet vs.DbQuery 和 FromSqlRaw 时的不同结果
- c++ - 带有参数 std::ofstream& 的 C++“错误:没有匹配的调用函数”
- scala - 映射集合并返回与输入相同类型的容器
- batch-file - 如何在 Camunda Cockpit 中批量删除失败的作业?
- vue.js - 如何在 vuetify 文本区域标签中使用 v-icon 而不是文本?
- javascript - 如何使用 Javascript 初始化自定义 html 类
- python - 如何检索使用从 python 脚本调用的 shell 脚本创建的文件名和文件?
- svelte - 我无法让我的 Svelte 应用程序使用“npm run dev”进行编译
- c# - 在 C# 中,如何向已构建的类添加功能?
- angular - 在角度组件计划同步融合中获得专业内的#dateHeaderTemplate