Engineering scalable systems, cloud-native applications, and AI-powered solutions.

Solution- "PDB does not match image" issue in Post Build event in Visual Studio

This error normally occurs when you are using Post Build event to move your .PDB & .DLL files from you current project's bin directory to some other project's bin directory. And...

Ankush Jain

Ankush Jain

Lead Software Engineer (VP) | Software Architect

Published Mar 24, 2018Updated Nov 24, 2026

Root Cause

This error normally occurs when you are using Post Build event to move your .PDB & .DLL files from you current project's bin directory to some other project's bin directory. And when you run the project (in which you have copied the DLLs & PDBs), you find that you are no longer able to debug the project (whose DLLs & PDBs) you have copied from post build event.

Solution

Simply, stop the IIS before building the project. Because, it is the IIS, which stops a Web Project from copying it's DLL & PDB files after build completion. Once you stop IIS and build the project, IIS will stop using those DLL & PDB files and these files will get copied on destination location & hence this issue will get fixed.

Cheers & Happy Coding...!!!

Have feedback or thoughts?

Discuss this article or share it on Twitter / GitHub.