[英]NU1107: Version conflict detected for Microsoft.CodeAnalysis.Common
I'm having issues when I try to build the application that leads me to run a package restore, but that fails, and I can't update packages either.我在尝试构建导致我运行 package 恢复的应用程序时遇到问题,但失败了,我也无法更新包。
NU1107 Version conflict detected for Microsoft.CodeAnalysis.CSharp.Workspaces.
Install/reference Microsoft.CodeAnalysis.CSharp.Workspaces 4.4.0 directly to project DACRL.Portal.Admin to resolve this issue.
DACRL.Portal.Admin -> Microsoft.VisualStudio.Web.CodeGeneration.Design 7.0.1 -> Microsoft.VisualStudio.Web.CodeGenerators.Mvc 7.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration 7.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 7.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.Core 7.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.Templating 7.0.1 -> Microsoft.VisualStudio.Web.CodeGeneration.Utils 7.0.1 -> Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.4.0)
DACRL.Portal.Admin -> Telerik.UI.for.AspNet.Core 2022.3.1109 -> Microsoft.CodeAnalysis 4.0.0 -> Microsoft.CodeAnalysis.CSharp.Workspaces (= 4.0.0).
I have the latest SDK installed:我安装了最新的 SDK:
And the whole solution (each project) is set to .net 7.0:整个解决方案(每个项目)设置为 .net 7.0:
<TargetFramework>net7.0</TargetFramework>
And the global.json is also setup correctly: global.json 也设置正确:
{
"sdk": {
"version": "7.0.101"
}
}
The last thing that it advises is to manually install Microsoft.CodeAnalysis.Common 4.4.0
directly to project DACRL.Portal.Admin
, and that also fails.它建议的最后一件事是将
Microsoft.CodeAnalysis.Common 4.4.0
直接手动安装到项目DACRL.Portal.Admin
,这也失败了。
NU1107: Version conflict detected for Microsoft.CodeAnalysis.Common.
Install/reference Microsoft.CodeAnalysis.Common 4.4.0 directly to project DACRL.Portal.Admin to resolve this issue.
DACRL.Portal.Admin -> Microsoft.CodeAnalysis.CSharp.Workspaces 4.4.0 -> Microsoft.CodeAnalysis.Common (= 4.4.0)
DACRL.Portal.Admin -> Microsoft.VisualStudio.Web.CodeGeneration.Design 7.0.0 -> Microsoft.DotNet.Scaffolding.Shared 7.0.0 -> Microsoft.CodeAnalysis.CSharp.Features 4.0.0 -> Microsoft.CodeAnalysis.Common (= 4.0.0).
It seems that Telerik.UI.for.AspNet.Core 2022.3.1109
added v4.0.0 of Microsoft.CodeAnalysis.*
DLLs.似乎
Telerik.UI.for.AspNet.Core 2022.3.1109
添加了 v4.0.0 的Microsoft.CodeAnalysis.*
DLL。 I had to manually add the following NuGtes:我必须手动添加以下 NuGtes:
Microsoft.CodeAnalysis.Common Microsoft.CodeAnalysis.Common
Microsoft.CodeAnalysis.Workspaces.Common Microsoft.CodeAnalysis.Workspaces.Common
Microsoft.CodeAnalysis.CSharp Microsoft.CodeAnalysis.CSharp
Microsoft.CodeAnalysis.CSharp.Workspaces Microsoft.CodeAnalysis.CSharp.Workspaces
Microsoft.CodeAnalysis.VisualBasic Microsoft.CodeAnalysis.VisualBasic
Microsoft.CodeAnalysis.VisualBasic.Workspaces Microsoft.CodeAnalysis.VisualBasic.Workspaces
Now, solution compiles and NuGets get appropriately updated.现在,解决方案编译并且 NuGets 得到适当更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.