Skip to content
Latchkey

NuGet "NU1202: package is not compatible with framework" in CI

The package was found and the version resolved, but it ships no build assets for your target framework. NU1202 lists the frameworks the package does support, which tells you whether to change your TFM or pick a different package version.

What this error means

Restore fails with NU1202 naming the package, your TFM, and the "supports:" list of frameworks the package actually targets. Deterministic for a given package version and project TFM.

dotnet
error NU1202: Package Legacy.Lib 1.0.0 is not compatible with net8.0
(.NETCoreApp,Version=v8.0). Package Legacy.Lib 1.0.0 supports: net48 (.NETFramework,Version=v4.8)

Common causes

The package only targets a framework you are not building

A package that ships only net48 assets cannot be consumed by a net8.0 project - there is no compatible asset to restore.

A newer package version dropped support for your TFM

An upgrade moved the package to a higher minimum framework than your project targets.

How to fix it

Use a package version that supports your TFM

  1. Check the package's supported frameworks on the feed.
  2. Pin a version whose assets cover your target framework.
  3. Re-run restore.
.csproj
<PackageReference Include="Legacy.Lib" Version="2.0.0" />

Multi-target or change your TFM

  1. If the package only supports an older framework, multi-target the project (e.g. net48;net8.0).
  2. Or change the project's TargetFramework to one the package supports.
  3. Restore and build.
.csproj
<PropertyGroup>
  <TargetFrameworks>net48;net8.0</TargetFrameworks>
</PropertyGroup>

How to prevent it

  • Confirm a package targets your TFM before adding or upgrading it.
  • Watch release notes for minimum-framework bumps on upgrades.
  • Multi-target libraries that must support both old and new frameworks.

Frequently asked questions

What causes ""NU1202: ... not compatible""?
A package that ships only net48 assets cannot be consumed by a net8.0 project - there is no compatible asset to restore.
How do I fix "NU1202: ... not compatible"?
Use a package version that supports your TFM

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card