Skip to content
Latchkey

NuGet NU1701 "restored using fallback framework" in CI

NU1701 warns that a package had no assets for your target framework, so NuGet fell back to a compatible framework (often .NETFramework) to restore it. It may work, but it is not a native match and fails CI under WarningsAsErrors.

What this error means

restore prints "warning NU1701: Package X was restored using .NETFramework,Version=v4.6.1 instead of the project target framework net8.0. This package may not be fully compatible".

dotnet
warning NU1701: Package 'Contoso.OldSdk 1.2.0' was restored using
      '.NETFramework,Version=v4.6.1' instead of the project target framework 'net8.0'.
      This package may not be fully compatible with your project.

Common causes

The package has no assets for your target framework

The package predates or omits your TFM, so NuGet used a fallback framework to restore it rather than failing outright.

A legacy package pulled into a modern project

A .NET Framework-only package is referenced by a net8.0 project, triggering the fallback restore.

How to fix it

Use a package that natively targets your TFM

  1. Check whether a newer version of the package supports your target framework.
  2. Upgrade to it so restore no longer needs the fallback.
  3. If none exists, verify at runtime that the fallback assets actually work.
.csproj
<PackageReference Include="Contoso.OldSdk" Version="2.0.0" />

Suppress the warning only after verifying compatibility

If the fallback is intentional and tested, scope a NoWarn to NU1701 rather than treating it as an error.

.csproj
<NoWarn>$(NoWarn);NU1701</NoWarn>

How to prevent it

  • Prefer packages that natively target your project frameworks.
  • Track fallback-restored packages and test them thoroughly.
  • Suppress NU1701 narrowly and only after verification.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →