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".
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
- Check whether a newer version of the package supports your target framework.
- Upgrade to it so restore no longer needs the fallback.
- If none exists, verify at runtime that the fallback assets actually work.
<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.
<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.