.NET 8项目编译失败:多个NuGet包不兼容NU1202错误求助
.NET 8解决方案构建时NU1202 NuGet包兼容错误问题
问题描述
克隆代码仓库后构建.NET 8解决方案,触发多个NU1202类型的NuGet包编译错误,提示以下包不兼容net8.0且未支持任何目标框架:
- Microsoft.Graph 5.49.0
- Microsoft.Graph.Core 3.1.10
- 多个版本的Microsoft.Kiota系列包
此外曾出现过Microsoft.IdentityModel.Abstractions 7.4.1与net8.0-windows7.0不兼容的错误,但当前无法复现该问题。
已执行的排查操作
- 清理解决方案
- 清除本地NuGet缓存
- 修复并重装Visual Studio 2022
- 重装.NET 8 SDK及运行时
环境详情(dotnet --info输出)
.NET SDK: Version: 8.0.204 Commit: c338c7548c Workload version: 8.0.200-manifests.7d36c14f Runtime Environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.204\ .NET workloads installed: There are no installed workloads to display. Host: Version: 8.0.4 Architecture: x64 Commit: 2d7eea2529 .NET SDKs installed: 8.0.204 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found
内容的提问来源于stack exchange,提问作者Themelis
相关产品推荐
相关产品推荐

