C# Visual Studio 2019错误:未找到方法:';System.Collections.Immutable.IImmutableDictionary`2

C# Visual Studio 2019错误:未找到方法:';System.Collections.Immutable.IImmutableDictionary`2,c#,.net,visual-studio,C#,.net,Visual Studio,我安装了最新版本的Visual Studio 2019,并且更新了我的Windows 10。使用IDE时存在一些问题。当我尝试创建包含.Net core控制台应用程序的示例解决方案时,会创建项目(.csproj)和解决方案(.sln)文件,但不会将项目添加到解决方案中。以下是解决方案资源管理器: 我在PowerShell中通过以下命令手动将项目添加到解决方案中: dotnet sln .\ConsoleApp6.sln add .\ConsoleApp6\ConsoleApp6.csproj

我安装了最新版本的Visual Studio 2019,并且更新了我的Windows 10。使用IDE时存在一些问题。当我尝试创建包含.Net core控制台应用程序的示例解决方案时,会创建项目(.csproj)和解决方案(.sln)文件,但不会将项目添加到解决方案中。以下是解决方案资源管理器:

我在PowerShell中通过以下命令手动将项目添加到解决方案中:

dotnet sln .\ConsoleApp6.sln add .\ConsoleApp6\ConsoleApp6.csproj
之后,出现一个错误:

以下是输出窗口中的错误详细信息:

 error  : Method not found: 'System.Collections.Immutable.IImmutableDictionary`2<System.String,System.String> Microsoft.VisualStudio.ProjectSystem.IProjectTreeCustomizablePropertyContext.get_Metadata()'
如图所示,VS找不到
System.Collections.Immutable
的第5版。我在谷歌上搜索了很多,有很多关于如何解决它的问题和答案,但没有一个对我有用。我卸载了.Net 5,这个错误消失了,但第一个错误仍然只存在于Visual Studio 2019中


我想知道是否有人可以帮助解决这个问题。

看起来VS 2019的安装可能有问题。请尝试从Visual Studio安装程序>VS 2019>更多>修复中修复VS 2019。如果“修复”无效,请尝试卸载VS 2019,然后重新安装VS 2019。如果此错误仍然存在,请在中向VS产品团队报告此问题。
error  : Could not load file or assembly 'System.Collections.Immutable, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.