.NET SDK "NETSDK1141: unable to resolve framework reference" in CI
NETSDK1141 means a FrameworkReference (the ASP.NET Core shared framework, Windows Desktop, etc.) cannot be resolved for the target version because the matching shared framework pack is not installed alongside the SDK on the runner.
What this error means
The build fails with NETSDK1141 naming the framework reference and version it could not resolve. It reproduces until the right SDK/pack is present.
dotnet
error NETSDK1141: Unable to resolve the .NET 9.0-windows reference
Microsoft.WindowsDesktop.App. The targeting pack may not be installed.Common causes
The shared framework pack is missing for the TFM
The project references ASP.NET Core or Windows Desktop for a version whose targeting/runtime pack the installed SDK does not include.
Wrong SDK installed for the framework reference
Only the base .NET SDK is present, but the project needs the ASP.NET Core or desktop workload/pack for that version.
How to fix it
Install the matching SDK and pack
- Install the SDK version that bundles the needed shared framework (setup-dotnet installs ASP.NET Core packs with the SDK).
- For Windows Desktop, build on a Windows runner with the desktop pack available.
- Confirm the
FrameworkReferenceversion aligns with the installed packs, then rebuild.
workflow
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'How to prevent it
- Match the runner SDK and OS to the framework references the project uses.
- Keep TFM and FrameworkReference versions consistent across projects.
Related guides
dotnet "NETSDK1141: Unable to resolve the .NET SDK version" in CIFix dotnet "error NETSDK1141: Unable to resolve the .NET SDK version as specified in the global.json" in CI -…
.NET SDK "NETSDK1045: current SDK does not support targeting" in CIFix .NET "NETSDK1045: The current .NET SDK does not support targeting .NET X. Either target .NET Y or use a n…
dotnet "The framework Microsoft.AspNetCore.App was not found"Fix "The framework Microsoft.AspNetCore.App, version x was not found" at runtime in CI - the ASP.NET Core sha…