asp.net-core – 为Microsoft.CodeAnalysis.Common检测到版本冲突.直接从项目引用包以解决此问题

前端之家收集整理的这篇文章主要介绍了asp.net-core – 为Microsoft.CodeAnalysis.Common检测到版本冲突.直接从项目引用包以解决此问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想通过Nuget Package Manager在我的asp.net核心应用程序中添加FluentValidation Nuget包.虽然添加我收到此错误

Severity Code Description Project File Line Suppression State
Error Version conflict detected for Microsoft.CodeAnalysis.Common.
Reference the package directly from the project to resolve this issue.
Project Name -> FluentValidation.AspNetCore 7.6.103 ->
Microsoft.AspNetCore.Mvc 2.1.0 -> Microsoft.AspNetCore.Mvc.TagHelpers
2.1.0 -> Microsoft.AspNetCore.Mvc.Razor 2.1.0 -> Microsoft.CodeAnalysis.Razor 2.1.0 -> Microsoft.CodeAnalysis.Common
(>= 2.8.0) Project Name ->
Microsoft.VisualStudio.Web.CodeGeneration.Design 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.Core 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.Templating 2.0.0 ->
Microsoft.VisualStudio.Web.CodeGeneration.Utils 2.0.0 ->
Microsoft.CodeAnalysis.CSharp.Workspaces 2.3.1 ->
Microsoft.CodeAnalysis.Workspaces.Common 2.3.1 ->
Microsoft.CodeAnalysis.Common (= 2.3.1).

我该如何解决这个错误

解决方法

刚遇到同样的问题.
不幸的是,这个包指的是.net core 2.1,它与2.0不兼容.

以下是我设法解决此问题的方法

– 从https://www.microsoft.com/net/download/windows安装2.1 SDK

– 遵循https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1的迁移说明

希望能帮助到你!

原文链接:https://www.f2er.com/aspnet/248742.html

猜你在找的asp.Net相关文章