MSBuild "MSB3644: reference assemblies were not found" in CI
MSB3644 means MSBuild cannot find the reference assemblies (targeting pack) for the framework the project targets. On a CI runner this usually means the SDK/targeting pack for that framework version is not installed, or a legacy .NET Framework target lacks its developer pack.
What this error means
Build fails with MSB3644 naming the framework version whose reference assemblies are missing, often suggesting installing the targeting pack. Deterministic for the runner's installed packs.
error MSB3644: The reference assemblies for .NETFramework,Version=v4.8 were not found.
To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version.Common causes
The targeting pack is not installed on the runner
The framework version the project targets has no reference assemblies present, so MSBuild cannot compile against it.
A .NET Framework target lacks its developer pack
Legacy net48-style targets need the Windows developer/targeting pack, which a Linux or minimal runner does not have.
How to fix it
Install the targeting pack on the runner
- Add a setup step that installs the SDK/targeting pack for the targeted framework.
- For .NET (Core) targets, use the matching SDK; for .NET Framework, install the developer pack on a Windows runner.
- Rebuild.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'Target a framework the runner supports
- If a legacy framework cannot be installed, retarget to a supported
net8.0-style TFM. - For .NET Framework, run on a Windows runner with the dev pack.
- Rebuild.
How to prevent it
- Install the exact SDK/targeting pack your TFMs need in CI setup.
- Match the runner OS to the framework (Windows for .NET Framework).
- Pin SDK versions so the targeting packs are predictable.