简体   繁体   English

NU1107:检测到 Microsoft.CodeAnalysis.Common 的版本冲突

[英]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:

dotnet --list-sdks

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.

相关问题 更新 Microsoft Graph NuGet 包后与“System.Runtime”冲突 - Conflict with "System.Runtime" after updating Microsoft Graph NuGet package Microsoft Visual Studio Enterprise 2022(64 位)- 版本 17.4.3 出现问题 - Trouble with Microsoft Visual Studio Enterprise 2022 (64-bit) - Version 17.4.3 将 VS 更新到 Microsoft Visual Studio Enterprise 2022(64 位)后,Doc 文件已损坏错误 - 预览版 17.2.0 预览版 2 - Doc file has been corrupted error after updating VS to Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview Version 17.2.0 Preview 2 JsonApiDotNetCore 5.0.1 与最新版本的 Visual Studio 2022(版本 17.3.0)中断 - JsonApiDotNetCore 5.0.1 Breaks with latest version of Visual Studio 2022 (Version 17.3.0) Excel 插件版本自动更新 - Excel Addins Version auto Update 如何解决Microsoft Visual Studio 2022加载Fortran个项目的问题? - How to solve the problem of loading Fortran projects in Microsoft Visual Studio 2022? 将 Microsoft.WindowsAppSDK 从 1.0.0-experimental1 更新到 1.0.0 - Update the Microsoft.WindowsAppSDK from 1.0.0-experimental1 to 1.0.0 升级VS2022预览版到发布版 - Upgrade VS2022 preview to release version 错误 XA2002:无法解析参考:`Microsoft.Bcl.AsyncInterfaces` - Error XA2002: Can not resolve reference: `Microsoft.Bcl.AsyncInterfaces` System.InvalidOperationException:&#39;Microsoft.ACE.OLEDB.12.0&#39; 提供程序未在本地计算机上注册。&#39; - System.InvalidOperationException: 'The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM