Could not load file or assembly 'X, Version=…' or one of its dependencies
The runtime couldn’t find or load a referenced DLL — missing from the output, wrong version, or wrong platform (x86/x64).
Meaning
The assembly binder needs the exact referenced version (or a binding redirect on .NET Framework). Deployments missing a DLL, version conflicts between packages, and 32/64-bit mismatches are the classic causes.
Common causes
- DLL not copied to the output/publish folder
- Two packages require different versions (needs binding redirect on .NET Framework)
- x86/x64 mismatch (BadImageFormatException)
- Missing native dependency of a managed package
- Assembly blocked after download (Windows “Unblock”)
⚡ Quick fix
- Clean, restore and republish (
dotnet publish -c Release) - .NET Framework: enable AutoGenerateBindingRedirects
- Match the platform target to the native dependencies
- Check the fusion log for the exact probing failure
Detailed fix by platform
.NET
- .NET Framework: set
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>; use Fuslogvw.exe to see binding failures. .NET (Core): check*.deps.jsonand usedotnet list package --include-transitivefor conflicts.
How to diagnose
- Assembly — Which name and version?
- Output — Is the DLL in the publish folder?
- Versions — Conflicting package versions?
- Platform — x86 vs x64?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026