user1140479
user1140479

Reputation:

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.LinkedListNode1<!0> System.Collections.Generic.LinkedList1.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, Nullable1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectRootElementCacheBase projectRootElementCache, Boolean isExplicitlyLoaded, Nullable1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectCollection projectCollection, Nullable1 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.LinkedListNode1<!0> System.Collections.Generic.LinkedList1.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, Nullable1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectRootElementCacheBase projectRootElementCache, Boolean isExplicitlyLoaded, Nullable1 preserveFormatting) at Microsoft.Build.Construction.ProjectRootElement.Open(String path, ProjectCollection projectCollection, Nullable1 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.HandleNonSuccessAndDebuggerNotification(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:

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

Upvotes: 8

Views: 1017

Answers (3)

Soleil
Soleil

Reputation: 7457

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.

Upvotes: 1

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\dotnet\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.

enter image description here enter image description here

Upvotes: 0

Shaybakov
Shaybakov

Reputation: 756

check this solution

open .csproj and remove this tag

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

Upvotes: 0

Related Questions