visual-studio 如何让 Visual Studio 进入第三方程序集

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2481677/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 11:40:21  来源:igfitidea点击:

How to get Visual Studio to step into third party assemblies

visual-studiodebuggingreflector

提问by Kye

When I'm debugging or even coding, it would be really uesful to examine third party assemblies but I can only see their metadata.

当我调试甚至编码时,检查第三方程序集真的很有用,但我只能看到它们的元数据。

Given that tools like reflector can decompile assemblies, is there someway or some tool which would allow visual studio to do the same thing?

鉴于像反射器这样的工具可以反编译程序集,是否有某种方式或某种工具可以让 Visual Studio 做同样的事情?

If I happen to have access to the PDB files for an assemblies, would placing them into my applications bin folder allow me to examine the assemblies content through visual studio?

如果我碰巧可以访问程序集的 PDB 文件,是否可以将它们放入我的应用程序 bin 文件夹中,以便我通过 Visual Studio 检查程序集内容?

回答by JaredPar

If you have PDB's for a DLL you can certainly examine the DLL while debugging. Make sure that you have "Just My Code Disabled" and you should be good to go

如果您有 DLL 的 PDB,您当然可以在调试时检查 DLL。确保您已禁用“仅禁用我的代码”并且您应该很高兴

Tools -> Options -> Debugging -> Uncheck "Just my Code"

工具 -> 选项 -> 调试 -> 取消选中“仅我的代码”

There is one caveat though, the Visual Studio debugger will not decompile the assembly. It will read source file information from the PDB, if available, and suggest a location to look for the source file. If you do not have access to the source fie you will be forced to look at the machine disassembly (not decompiled IL) while debugging.

但是有一个警告,Visual Studio 调试器不会反编译程序集。如果可用,它将从 PDB 读取源文件信息,并建议一个位置来查找源文件。如果您无权访问源文件,您将被迫在调试时查看机器反汇编(不是反编译的 IL)。

回答by Salami

You can load the pdbs through the call stack.

您可以通过调用堆栈加载 pdb。

Just right click on a function that you want to load the pdb for, then go to 'Load Symbols'. Browse for the correct pdb, and press OK. After that, it should be able to provide information for the calls in that pdb.

只需右键单击要为其加载 pdb 的函数,然后转到“加载符号”。浏览正确的 pdb,然后按 OK。之后,它应该能够为该 pdb 中的调用提供信息。

回答by Saif Khan

Try .NET reflector Pro here.

在此处尝试 .NET 反射器 Pro

I believe it's also available in their free version.

我相信它也可以在免费版本中使用。