简体   繁体   中英

Update Visual Studio 2019 errors

I had an update for Visual Studio 2019 community. I am now on version 16.10.2. But now I can't open my solutions anymore. Existing projects aren't loading and the log says this:

===================== 18-6-2021 08:58:43 Recoverable System.MissingMethodException: Method not found: 'System.Collections.Generic.LinkedListNode 1<.0> System.Collections.Generic.LinkedList 1.gdt_Last()'. at Microsoft.Build.Evaluation.ProjectRootElementCache.BoostEntryInStrongCache(ProjectRootElement projectRootElement) at Microsoft.Build.Evaluation.ProjectRootElementCache.RenameEntryInternal(String oldFullPathIfAny, ProjectRootElement projectRootElement) at Microsoft.Build.Evaluation.ProjectRootElementCache.AddEntry(ProjectRootElement projectRootElement) at Microsoft.Build.Construction.ProjectRootElement..ctor(String path, ProjectRootElementCacheBase projectRootElementCache, Boolean preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.OpenLoader(String path, ProjectRootElementCacheBase projectRootElementCache) at Microsoft.Build.Evaluation.ProjectRootElementCache.Get(String projectFile, OpenProjectRootElement openProjectRootElement, Boolean isExplicitlyLoaded, Nullable 1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectRootElementCacheBase projectRootElementCache, Boolean isExplicitlyLoaded, Nullable 1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectCollection projectCollection, Nullable 1 preserveFormatting) at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.Microsoft.VisualStudio.ProjectSystem.IProjectLockReleaser.GetProjectXmlAsync(String projectFile, CancellationToken cancellationToken) at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.<>c__DisplayClass185_0.<<SaveUserFileAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__76.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.<ExecuteWithinLockAsync>d__128.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.<ExecuteWithinLockAsync>d__128.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.<DisposeAsync>d__174.MoveNext() =================== 18-6-2021 08:58:43 Recoverable System.MissingMethodException: Method not found: 'System.Collections.Generic.LinkedListNode 1 preserveFormatting) at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.Microsoft.VisualStudio.ProjectSystem.IProjectLockReleaser.GetProjectXmlAsync(String projectFile, CancellationToken cancellationToken) at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.<>c__DisplayClass185_0.<<SaveUserFileAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__76.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.<ExecuteWithinLockAsync>d__128.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.<ExecuteWithinLockAsync>d__128.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.<DisposeAsync>d__174.MoveNext() =================== 18-6-2021 08:58:43 Recoverable System.MissingMethodException: Method not found: 'System.Collections.Generic.LinkedListNode 1<.0> System.Collections.Generic.LinkedList 1.gdt_Last()'. at Microsoft.Build.Evaluation.ProjectRootElementCache.BoostEntryInStrongCache(ProjectRootElement projectRootElement) at Microsoft.Build.Evaluation.ProjectRootElementCache.RenameEntryInternal(String oldFullPathIfAny, ProjectRootElement projectRootElement) at Microsoft.Build.Evaluation.ProjectRootElementCache.AddEntry(ProjectRootElement projectRootElement) at Microsoft.Build.Construction.ProjectRootElement..ctor(String path, ProjectRootElementCacheBase projectRootElementCache, Boolean preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.OpenLoader(String path, ProjectRootElementCacheBase projectRootElementCache) at Microsoft.Build.Evaluation.ProjectRootElementCache.Get(String projectFile, OpenProjectRootElement openProjectRootElement, Boolean isExplicitlyLoaded, Nullable 1.gdt_Last()'. at Microsoft.Build.Evaluation.ProjectRootElementCache.BoostEntryInStrongCache(ProjectRootElement projectRootElement) at Microsoft.Build.Evaluation.ProjectRootElementCache.RenameEntryInternal(String oldFullPathIfAny, ProjectRootElement projectRootElement) at Microsoft.Build.Evaluation.ProjectRootElementCache.AddEntry(ProjectRootElement projectRootElement) at Microsoft.Build.Construction.ProjectRootElement..ctor(String path, ProjectRootElementCacheBase projectRootElementCache, Boolean preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.OpenLoader(String path, ProjectRootElementCacheBase projectRootElementCache) at Microsoft.Build.Evaluation.ProjectRootElementCache.Get(String projectFile, OpenProjectRootElement openProjectRootElement, Boolean isExplicitlyLoaded, Nullable 1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectRootElementCacheBase projectRootElementCache, Boolean isExplicitlyLoaded, Nullable 1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectCollection projectCollection, Nullable 1 preserveFormatting) at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.Microsoft.VisualStudio.ProjectSystem.IProjectLockReleaser.GetProjectXmlAsync(String projectFile, CancellationToken cancellationToken) at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.<>c__DisplayClass185_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.d__76.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebu ggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.d__128.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.d__128.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.d__174.MoveNext() ===================

If I start a new solution with a MVC Api the solution is created, but the project is not added. Adding it to the solution manually gives me this error:

Method not found: 'System.Collections.Generic.LinkedListNode1<.0> System.Collections.Generic.LinkedList1.gdt_Last()'

What I tried:

  • Repair Visual Studio
  • Uninstalled Visual Studio and everything that has to do with .NET or Microsoft frameworks
  • Googled (nothing found)

Does anyone have any idea why this happens all of a sudden?

I suspect the newest version of VS2019 updated the solution cache, without backward compatibility or corrupted it. Try to delete the hidden folder .vs in your solution folder and reopen your solution with the VS2019 you want to use.

check this solution

open.csproj and remove this tag

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> bla-bla </Target>

Here is my 2¢:

  1. If your project has NuGet packages, examine and update each one properly.
  2. I'm not sure that you have the latest version of.Net which is recently 5. What happened when you get System.Collections.dll and replace it with the correlated.dll file having the same name. For example, the dll is in C:\Program Files\do.net\packs\Microsoft.NETCore.App.Ref\5.0.0\ref.net5.0 in my computer.

However, I think when you update your framework to.Net 5 along with updating related NuGet packages fixes the issue.

How to change the project version?

Right click on project, Properties --> Application --> Target framework . Target framework dropdown displays list of frameworks installed on your machine. If you don't want to update it, at least take.Net 5 and make the version down in the dropdown menu.

在此处输入图像描述 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM