.net Resharper调试第三方反编译的dll
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9682874/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Resharper debugging a third party decompiled dll
提问by Noel
Is there a way to debug into a decompiled dll using Resharper and if so how do you do this?
有没有办法使用 Resharper 调试到反编译的 dll 中,如果是这样,你怎么做?
For example I am trying to debug into System.Web.Http.ApiControllerwhere I have decompiled and can see the source.
例如,我试图调试到System.Web.Http.ApiController我已经反编译并可以看到源代码的地方。
I have set a breakpoint but when I run the application it does not break into decompiled breakpoint when debugging.
我已经设置了一个断点,但是当我运行应用程序时,它不会在调试时进入反编译断点。
采纳答案by Robbie
As far as i am aware it is not possible to debug the decompiled .net source code using Resharper (up to v6.1)
据我所知,无法使用 Resharper(最高 v6.1)调试反编译的 .net 源代码
However, this articleexplains 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.
但是,本文解释了如何使用 Visual Studio 2010 调试到 .net 源代码 - 如果您需要其他版本的 VS 的说明,只需使用页面顶部的“其他版本”链接。
回答by Fab
Yes, you can with Resharper 9.0
是的,您可以使用 Resharper 9.0
(not sure for previous versions).
(不确定以前的版本)。
Go to menu "Resharper"> "Windows"> "Assembly Explorer"
转到菜单“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.
- 在左侧添加一个带有第一个按钮的程序集(上面有一个+)
- 然后右键单击它并选择“生成 Pdb...”(等待它完成)
- 现在你可以破解代码了。
Note however as Jens told, it will probably break license terms
但是请注意,正如 Jens 所说,它可能会违反许可条款
回答by Shkredov S.
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.
dotPeek 1.2 中引入了调试工具,这里有一篇很好的文章,描述了如何配置符号服务器和 dotPeek 1.2 以调试来自 VisualStudio 的反编译代码:http://blog.jetbrains.com/dotnet/2014/04/09/introducing-dotpeek -1-2-early-access-program。
回答by Tomás Escamez
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.
在Assembly Explorer 窗口中选择一个程序集,然后单击工具栏上的Export to Project,或在上下文菜单中选择Export to Project。
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
取消选中“启用 .NET Framework 源步进”选项
Check the "Enable source server support" option
勾选“启用源服务器支持”选项
Uncheck the "Require source files to exactly match the original version
取消选中“要求源文件与原始版本完全匹配
回答by Lasse V. Karlsen
No, that will not be possible with just Visual Studio and ReSharper, but there is another product that may help you, .NET Reflector.
不,仅使用 Visual Studio 和 ReSharper 是不可能的,但还有另一种产品.NET Reflector可以帮助您。
The VSProedition 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.
该VSPro版的功能,它允许你产生.pdb文件和反编译源代码已经内置.NET程序集是“使用Visual Studio调试器,即使你没有源调试组件”。
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.
使用 ReSharper,您可以查看来自程序集的反编译源代码,这与 Reflector 生成反编译源代码的方式几乎相同,但您无法使用 ReSharper 使用这些源文件调试代码。
回答by Skimedic
[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.
[完全披露 - 我是 Telerik 员工] 随着 Telerik 的JustCode的最新版本,您现在无需离开 Visual Studio 就可以调试反编译的代码。有关更多信息,您可以在此处阅读我宣布该功能的博客文章。
回答by Jens H
You would need to have the corresponding *.pdbfiles to step into the code.
您需要有相应的*.pdb文件才能进入代码。
Otherwise, it might help to decompile the binary file with e.g. Telerik's freely available JustDecompile.
否则,使用 Telerik 免费提供的JustDecompile来反编译二进制文件可能会有所帮助。
But you should be aware that this might violate license agreementsof the third party provider.
但您应该知道,这可能会违反第三方提供商的许可协议。

