You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 23:10:03