The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.
Detailed Information:
Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
中文会报这个:
无法找到 .NET Core SDK。请检查确保已安装此项且 global.json 中指定的版本(如有)与所安装的版本相匹配。
找到根目录下的 global.json 文件,
查看 SDK要求的 .Net Core 版本,如下图要求 3.1.100
{
"sdk": {
"version": "3.1.100",
"allowPrerelease": false,
"rollForward": "latestMajor"
}
}
global.json 概述 参考:https://docs.microsoft.com/zh-cn/dotnet/core/tools/global-json?tabs=netcore3x
到这里下载对应的版本、并安装:https://dotnet.microsoft.com/download/dotnet-core
如果只是查看代码,而不需要编译执行,可以把global给去掉,就可以直接打开了。