Reputation: 5369
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.
Upvotes: 63
Views: 39421
Reputation: 14813
(not sure for previous versions).
Go to menu "Resharper" > "Windows" > "Assembly Explorer"
Note however as Jens told, it will probably break license terms
Upvotes: 62
Reputation: 552
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
Upvotes: 12
Reputation: 2117
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.
Upvotes: 16
Reputation: 19500
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.
Upvotes: 8
Reputation: 808
[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.
Upvotes: 6
Reputation: 391576
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.
Upvotes: 10
Reputation: 4632
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.
Upvotes: 1