I have a application that uses Roslyn API to analyze C# code inside separated solutions; After some Visual Studio updates, i'm receiving this error in my application:
Msbuild failed when processing the file '{separated solution .csproj file}' with message: Could not load type 'Microsoft.Build.Framework.SdkResultItem' from assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
This error is shown for each project inside the analyzed solution; i can see the errors inside the variable ws.Diagnostics
at:
using var ws = MSBuildWorkspace.Create();
ws.LoadMetadataForReferencedProjects = true;
var solution = await ws.OpenSolutionAsync(solutionPath,
msbuildLogger: buildLogger,
cancellationToken: cancellationToken);
Before the Visual Studio update my code was working; there is some way to fix it without reinstalling the Visual Studio?
I've alrey tried to renninstal the Microsoft.Build.Framework reference using the developer command prompt, but does not works.