Debug a protected assembly with Visual Studio
Debugging obfuscated Microsoft .NET assemblies
- Use the Open Project command within Visual Studio to select the obfuscated exe file (in the case of a dll, select the hosting exe file).
- Visual Studio now creates a debugging solution for you, in which you can use the Properties page of the project to more thoroughly control the debugging.
- Disable "Just my Code". Go to Debug|Options and Settings, and make sure that "Enable Just my Code (Managed only)" is deselected.
- To debug the obfuscated assembly, simply hit F5.
Breaking on first-chance exceptions
When debugging exceptions in obfuscated assemblies, often you would like to break on first-chance exceptions. To do that, you should follow these steps:
- When debugging your obfuscated assembly, watch the Output->Debug window.
- Among other things, this window display exceptions when they occur, with the text "First chance exception of type ...".
- Find out which type of exception is causing the error, and make Visual Studio break on first chance exceptions of this type by going to the Debug menu->Exceptions and selecting this exception type.
- Debug the project again, by this time VS should break directly on the exception.
Note: Make sure that you have the correct debuggers selected in your VS project options (on the Debug page).
See also
Add comment

User Comments