Assembly Mismatch After Version Upgrade in .NET Framework

After upgrading IronPDF in a .NET Framework project, the application throws this exception at runtime:

System.IO.FileLoadException: Could not load file or assembly 'IronPdf, Version=X.Y.Z.W,
Culture=neutral, PublicKeyToken=...' or one of its dependencies. The located assembly's
manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)

The NuGet package upgrade installs new assembly versions, but the old versions remain cached in the project's bin/Debug (or bin/Release) and runtimes output directories. .NET Framework resolves assemblies from these local folders before consulting the NuGet cache, so the stale cached DLLs conflict with the newly installed package and cause the binding failure.

Solution

Step 1: Uninstall IronPDF and all Iron-related packages (such as IronPdf.Slim, IronPdf.Native.Chrome.Windows) using NuGet Package Manager in Visual Studio (Tools > NuGet Package Manager > Manage NuGet Packages for Solution).

Step 2: Delete the runtimes folder and the bin/Debug (or bin/Release) folder from your project output directory.

Step 3: Reinstall IronPDF via NuGet Package Manager.

If Visual Studio cleanup is insufficient, clear the global NuGet cache via the command line and force a clean restore:

dotnet nuget locals all --clear
dotnet restore --force
dotnet nuget locals all --clear
dotnet restore --force
SHELL

For server deployments: remove all old IronPDF DLLs from the server directory before republishing. Deploy to a fresh directory and update IIS to point to the new location rather than overwriting files in place.

See also: IronPDF assembly version mismatch exception reference and failed NuGet package deployment.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 19,345,590 | Version: 2026.6 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronPdf
run a sample watch your HTML become a PDF.