简体   繁体   English

如果我只有 DLL 和 PDB 文件,有没有办法在按 F12 时浏览源代码?

[英]Is there a way to browser Source Code when pressing F12 if I only have the DLL and PDB files?

I have a very large solution (384 projects), and I usually work in only one of these projects at a time.我有一个非常大的解决方案(384 个项目),我通常一次只在其中一个项目中工作。 So when opening that project alone, pressing F12 brings me only to the metadata page of the used DLL.因此,单独打开该项目时,按 F12 只会将我带到所用 DLL 的元数据页面。 My project has reference to the DLL files created in the bigger solution.我的项目引用了在更大的解决方案中创建的 DLL 文件。

Is there a way to browse the Source Code when pressing F12 if I only have the DLL and PDB files?如果我只有 DLL 和 PDB 文件,有没有办法在按 F12 时浏览源代码?

There's no official way of doing so, but since a lot of years, there's a tool/extension called Reflector which disassembles MSIL into readable C# code .没有这样做的官方方法,但是多年来,有一个名为Reflector的工具/扩展 可以将 MSIL 反汇编为可读的 C# 代码

It works exactly as you want... You press F12 and it decompiles the code to show C# code.它完全按照您的意愿工作...您按F12并反编译代码以显示 C# 代码。 BTW, it won't never be the exact source code as you developed in your solution.顺便说一句,它永远不会是您在解决方案中开发的确切源代码。 It's a translation back from MSIL to C#.这是从 MSIL 到 C# 的转换。

It's not free, but AFAIK, there's a trial and maybe it's worth the price for you...它不是免费的,但是 AFAIK,有一个试用版,也许它对您来说物有所值...

JetBrains(ReSharper 的制造商)提供他们自己的 MSIL 反编译器,称为 dotPeek https://www.jetbrains.com/decompiler/您可以启用源服务器支持,它会在您 F12 时显示反编译的源代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何防止任何人在按F12键时看到方法语句代码? - How to prevent anyone sees method statements code when pressing F12? 使用C#获取Web的开发人员模式源代码(F12)(Web的动态源) - Get Developer Mode Source Code (F12) of a Web Page using C# (Dynamic Source of a web) 如何通过单击F12在Visual Studio 2015中查看依赖项的源代码? - How to view source code of dependencies in Visual Studio 2015 by clicking F12? Visual Studio转到定义(F12)打开对象浏览器而不是代码视图 - Visual Studio Go to Definition (F12) opens Object Browser instead of Code View 如何隐藏<summary>在 Visual Studio 代码中按 F12(转到定义)时的 [元数据]</summary> - How to hide <summary> in [metadata] when press F12 (Go to definition) in visual studio code 如何读取崩溃转储文件(我有源代码和.pdb文件) - How to read a crash dump file (I have source code and .pdb files) 当按F12进入Visual Studio 2015 / C#中的定义时出现错误 - I got error when press F12 Go to definition in Visual Studio 2015 / C# VS2010 C#:如何在按F12键时查看内部​​类的定义? - VS2010 C#: How to view internal classes definitions when I press F12? 如何按键执行字符串(F12)? - How to execute a string by key (F12)? 如何使用F12在Visual Studio中查看C#代码详细信息? - How to see the c# code detail in visual studio using F12?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM