首页 > 解决方案 > 截至今天,omnisharp 无法正常启动(无法从程序集中加载“CheckForDuplicateFrameworkReferences”任务 [...])

问题描述

完整的错误:

无法从程序集 /usr/lib64/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/../tools/net472/Microsoft.NET.Build.Tasks 加载“CheckForDuplicateFrameworkReferences”任务。 dll。无效图像 确认声明正确、程序集及其所有依赖项可用,并且任务包含实现 Microsoft.Build.Framework.ITask 的公共类。

看起来 C# 扩展是 6 天前更新的,我很肯定从那以后我一直在使用 VS Code。

我尝试创建一个新项目(dotnet new mvc),但打开它时出现同样的错误。

我尝试了 "omnisharp.path": "latest" 解决方案,但没有帮助。另外,我没有安装单声道,所以单声道设置也无济于事。

谁知道这个问题是否有其他解决方案?

标签: c#linuxvisual-studio-codeomnisharp

解决方案


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.


推荐阅读