在Visual Studio .NET中调试动态加载的程序集 [英] Debug dynamically loaded assembly in Visual Studio .NET

查看:125
本文介绍了在Visual Studio .NET中调试动态加载的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#和反射来从程序集加载和调用方法。我有程序本身的源代码。我需要做些什么才能使调试器进入(而不是结束)动态加载的程序集的代码?



如果我按F11 ...



谢谢

解决方案

在动态加载的程序集本地构建源,并确保您的引用应用程序正在运行的PDB文件。



对于希望调试的人来说,这是一个常见的要求ASP.NET MVC源代码。 一些注意事项关于GAC。



另一种快速(但很脏)的方法是临时将动态加载的程序集的项目添加到您的解决方案中。这是史蒂夫·桑德森建议的调试ASP.NET MVC框架。个人而言,我更喜欢PDB根。


I am using C# and reflection to load and invoke methods from an assembly. I have the source code of the assembly itself. What do I need to do to get the debugger to step into (and not over) the code of the dynamically loaded assembly ?

If I press F11 on the ....Invoke line it just steps over it ..

Thanks

解决方案

Build the source locally of dynamically loaded assembly and make sure you have the PDB files where the referencing app is running.

This is a common requirement for people wishing to debug the ASP.NET MVC source code. There are some caveats regarding the GAC though.

Another quick (but dirty) way to do is to temporarily add the project for the dynamically loaded assembly to your solution. This is what Steve Sanderson recommends for debugging the ASP.NET MVC framework. Personally I prefer the PDB root.

这篇关于在Visual Studio .NET中调试动态加载的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆