我试图将.net 5降级为.net核心3.1。现在,我改变了主意,想回到.net 5。现在,当我尝试安装Nuget软件包时,我遇到了一些奇怪的错误。我该怎么办?它要求的是Microsoft.CodeAnalysis.Common 3.8。但是这个软件包说“不要手动安装这个软件包,它将被其他需要它的软件包作为先决条件来添加”。
严重性代码描述项目文件行源抑制状态错误NU1107版本冲突检测到Microsoft.CodeAnalysis.Common。直接将Microsoft.CodeAnalysis.Common 3.8.0安装/引用到项目项目,以解决此问题。项目Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -> 5.0.2 -> Microsoft.CodeAnalysis.Razor 5.0.2 -> Microsoft.CodeAnalysis.Common (>= 3.8.0)项目-> Telerik.UI.for.AspNet.Core 2021.1.119 -> Microsoft.CodeAnalysis 3.7.0 -> Microsoft.CodeAnalysis.CSharp.Workspaces 3.7.0 -> Microsoft.CodeAnalysis.Common (= 3.7.0)项目C:\Users\ntimmerman\source\repos\PROJECT\PROJECT\PROJECT.csproj 1 IntelliSense
如果我继续安装它,我会收到警告:
严重性代码描述项目文件行源抑制状态警告NU1608检测到在依赖约束之外的包版本: Microsoft.CodeAnalysis.CSharp.Workspaces 3.7.0要求Microsoft.CodeAnalysis.Common (= 3.7.0),但版本Microsoft.CodeAnalysis.Common 3.8.0已解决。项目C:\Users\ME\source\repos\PROJECT\PROJECT\PROJECT.csproj 1构建
CSPROJ文件是:
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> <RootNamespace>PROJECT</RootNamespace> <UserSecretsId>SECRETID</UserSecretsId> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="5.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.Graph" Version="3.23.0" /> <PackageReference Include="Microsoft.Identity.Web" Version="1.5.1" /> <PackageReference Include="Microsoft.Identity.Web.UI" Version="1.5.1" /> <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2021.1.119" /> </ItemGroup> <ItemGroup>