如果Visual Studio 2010基于WPF,为什么我无法用反射器打开它?
如果Visual Studio 2010基于WPF,为什么我无法用反射器打开它?
换句话说,devenv.exe 似乎是本机程序集,那么 WPF UI 代码在哪里?
If Visual Studio 2010 based on WPF, why I cannot open it with reflector?
In other words, devenv.exe
seems to be native assembly, so where is the WPF UI code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Visual Studio
devenv.exe
可执行文件确实是一个本机程序。但是,本机程序可以加载 .NET 运行时,从而托管 Windows 窗体和 WPF 组件。事实上,Visual Studio 一直都是这么做的。甚至在 VS2010 采用 WPF 作为其编辑器和 shell 之前,各种 Visual Studio 设计器都是在 Windows 窗体中实现的。如果您进入Common7\IDE
和Common7\IDE\PrivateAssemblies
目录,您会发现许多可以在 Reflector 中查看的设计器 DLL(例如Microsoft .VisualStudio.ORDesigner.Dsl.dll
是 LINQ to SQL 设计器)。因此,Visual Studio 的新 WPF 位只是本机可执行文件中托管的另一组托管程序集。我不确定哪些特定程序集托管 WPF 位 - 老实说可能有几十个。但是查看调试器中的 VS 进程,我会说 Microsoft.VisualStudio.Editor.dll(位于 GAC 中,而不是 VS 安装目录中)将是一个不错的起点。
The Visual Studio
devenv.exe
executable is indeed a native program. However, native programs can load the .NET runtime and thereby host Windows Forms and WPF components. In fact, Visual Studio has always done this. Even before VS2010 adopted WPF for its editor and shell, the various Visual Studio designers were implemented in Windows Forms. If you go into theCommon7\IDE
andCommon7\IDE\PrivateAssemblies
directories, you'll find lots of designer DLLs that you can view in Reflector (e.g.Microsoft.VisualStudio.ORDesigner.Dsl.dll
is the LINQ to SQL designer).So the new WPF bits of Visual Studio are just another set of managed assemblies hosted in the native executable. I'm not sure which particular assemblies host the WPF bits -- and to be honest there are probably dozens. But looking at the VS process in the debugger, I'd say
Microsoft.VisualStudio.Editor.dll
(which lives in the GAC, not in the VS install directory) would be a good place to start.