The full error:
The “CheckForDuplicateFrameworkReferences” task could not be loaded from the assembly /usr/lib64/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/../tools/net472/Microsoft.NET.Build.Tasks.dll. Invalid Image Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
It seems like the C# extension was updated 6 days ago, and I’m positive that I’ve been using VS Code since then.
I’ve tried to create a new project (dotnet new mvc), but I get the same error when I open it.
I tried the “omnisharp.path”: “latest” solution, but it didn’t help. Also, I don’t have mono installed, so the mono setting wouldn’t help either.
Anyone who knows if there are other solutions to this problem?
Advertisement
Answer
As a last effort, I double checked here if I was using the right Fedora repository, and it turns out that I was not using microsoft’s own repository (I think they didn’t have one when I first installed dotnet), but a copr repository (copr repo for dotnet owned by @dotnet-sig).
When I replaced the copr version with the one from microsoft’s repository, everything worked like it should. Both were dotnet 5.0, so I didn’t think it would make a difference, but luckily it did.