调试动态加载的程序集在Visual Studio .NET

调试动态加载的程序集在Visual Studio .NET

问题描述:

我使用C#和反射来加载并调用从装配方法。我有大会本身的源代码。什么我需要做的就是调试器步入(不超过)动态加载的程序集的代码?

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 ?

如果我按在F11 ... .Invoke线就只有几步之遥了吧..

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

感谢

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

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

这是希望调试人民的共同要求ASP.NET MVC的源代码。有一些注意事项一>虽然关于GAC。

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

另一种快速的(但脏)的方式做的是暂时补充项目的动态加载的程序集到您的解决方案。这是史蒂夫·桑德森建议调试ASP.NET MVC框架。我个人比较喜欢PDB根。

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.