Sometimes, when you debug your applications, there is a need to step into the source code of a library that your are using, and for one reason or another you don’t have the PDBs and/or source code of that library. If you happen to use ReSharper you can easily do it for almost any such library.

As you probably know, ReSharper has a built-in decompiler that allows you to explore the source code of third-party libraries inside Visual Studio. But not everyone knows that ReSharper can also generate a PDB file for a given assembly so that you can debug that assembly with the decompiled sources. So here are the steps how you can do that:

Go to References in your project, right-click on the referenced assembly that you want to debug and select View in Assembly Explorer:


Then, right-click on your assembly in Assembly Explorer and select Generate PDB…:


Next, choose location where you want the PDB files to be stored and click Generate:


After the PDB generation is complete, you can start debugging your application and stop at a method call of the external library that you want to debug. For example, if we want to debug the JsonConvert.SerializeObject method, we would stop here:


At this point Visual Studio doesn’t know that we have the PDB files for the JSON.NET library and if we try to Step Into the SerializeObject method it will not work. We need to explicitly tell Visual Studio to load the symbols. We can do that from the Modules window in Visual Studio (Debug –> Windows –> Modules):


To load the PDB symbols right-click on the assembly, select Load Symbols and browse to the location where PDB were generated earlier, in my example here it is C:\Symbols\Newtonsoft.Json.pdb\64E07EBD3E4843B9A1E16CDE1CF6F4541\. Now the Symbol Status column should show Symbols loaded:


Now, if we return to our breakpoint and press F11 (Step Into) we will go inside the decompiled JsonConvert.SerializeObject method:


That’s it! This way you can debug just about any managed library out there without having access to the source code and/or PDB files.