Resharper debugging a third party decompiled dll

.NetDebuggingResharper

.Net Problem Overview


Is there a way to debug into a decompiled dll using Resharper and if so how do you do this?

For example I am trying to debug into System.Web.Http.ApiController where I have decompiled and can see the source.

I have set a breakpoint but when I run the application it does not break into decompiled breakpoint when debugging.

.Net Solutions


Solution 1 - .Net

Yes, you can with Resharper 9.0

(not sure for previous versions).

Go to menu "Resharper" > "Windows" > "Assembly Explorer"

  • Add an assembly there with the first button on the left (with a + on it)
  • Then right click on it and choose "Generate Pdb..." (wait until it's done)
  • now you're able to break in the code.

Note however as Jens told, it will probably break license terms

Solution 2 - .Net

Debugging facilities are introduced in dotPeek 1.2 and here is a nice post describing how to configure symbol server and dotPeek 1.2 to debug decompiled code from VisualStudio: http://blog.jetbrains.com/dotnet/2014/04/09/introducing-dotpeek-1-2-early-access-program.

Solution 3 - .Net

Select an assembly in the Assembly Explorer Window and click Export to Project on the toolbar, or choose Export to Project in the context menu.

More info here

Also, check you have this configuration on the main Debugging options page (Tools -> Options -> Debugging -> General):

Uncheck the "Enable Just My Code" option

Uncheck the "Enable .NET Framework source stepping" option

Check the "Enable source server support" option

Uncheck the "Require source files to exactly match the original version

Solution 4 - .Net

No, that will not be possible with just Visual Studio and ReSharper, but there is another product that may help you, .NET Reflector.

The VSPro edition has a "Debug assemblies using the Visual Studio debugger, even if you don’t have the source" feature, which allows you to produce .pdb files and decompiled source code for already built .NET assemblies.

From experience, it had some problems with some assemblies, but I can't remember why that was, so it may or may not help you.

With ReSharper you can look at decompiled source code from the assemblies, in pretty much the same way Reflector will produce decompiled source, but you cannot debug the code with those source files with ReSharper.

Solution 5 - .Net

As far as i am aware it is not possible to debug the decompiled .net source code using Resharper (up to v6.1)

However, this article explains how you can debug into the .net source with Visual Studio 2010 - if you need instructions for another version of VS, just use the "Other versions" link at the top of the page.

Solution 6 - .Net

[Full disclosure - I am a Telerik Employee] With the latest release of Telerik's JustCode, you can now debug decompiled code without ever leaving Visual Studio. For more information, you can read my blog post announcing the feature here.

Solution 7 - .Net

You would need to have the corresponding *.pdb files to step into the code.

Otherwise, it might help to decompile the binary file with e.g. Telerik's freely available JustDecompile.

But you should be aware that this might violate license agreements of the third party provider.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNoelView Question on Stackoverflow
Solution 1 - .NetFabView Answer on Stackoverflow
Solution 2 - .NetShkredov S.View Answer on Stackoverflow
Solution 3 - .NetTomás EscamezView Answer on Stackoverflow
Solution 4 - .NetLasse V. KarlsenView Answer on Stackoverflow
Solution 5 - .NetRobbieView Answer on Stackoverflow
Solution 6 - .NetSkimedicView Answer on Stackoverflow
Solution 7 - .NetJens HView Answer on Stackoverflow