MSBuild "MSB3644: reference assemblies were not found"
MSBuild could not find the reference assemblies (the targeting pack) for the .NET Framework version your project targets. On Linux/CI runners these packs are frequently absent.
What this error means
Build fails with MSB3644 naming a .NETFramework,Version=vX.Y whose reference assemblies are missing, suggesting you install the targeting pack or retarget. Common when building classic .NET Framework projects on hosted runners.
error MSB3644: The reference assemblies for .NETFramework,Version=v4.7.2 were not found.
To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework
version or retarget your application.Common causes
Targeting pack not installed
The reference assemblies for the targeted .NET Framework version are a separate developer pack that is not present on the runner.
Building .NET Framework on Linux
Classic .NETFramework targeting packs are Windows-oriented. A Linux runner without Mono/reference-assembly packages cannot resolve them.
How to fix it
Build .NET Framework on a Windows runner
Classic Framework projects build most reliably on windows-latest where the targeting packs ship.
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- run: dotnet build -c ReleaseInstall the targeting pack
On Windows runners, install the developer pack for the framework version, or reference the targeting-pack NuGet package.
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
</PackageReference>Or retarget to a modern framework
- If the project can move, retarget
<TargetFramework>tonet8.0and build cross-platform. - Confirm dependencies support the new target before switching.
- Keep Framework-only projects on Windows runners until they are migrated.
How to prevent it
- Build classic .NET Framework projects on Windows runners.
- Add the
Microsoft.NETFramework.ReferenceAssembliespackage for Framework targets. - Migrate to
net8.0+ where possible for cross-platform CI.