调试动态加载的程序集

编程入门 行业动态 更新时间:2024-10-27 23:29:50
本文介绍了调试动态加载的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我调试,我动态加载的的Assembly.Load(字节[]),但我面临的一些问题。

I am debugging an assembly which I loaded dynamically with Assembly.Load(Byte[]), but I am facing some problems.

首先,我不能动的黄色箭头在Visual Studio 2010中步入其他线路的code,而且我getiing异常(无法找到对象实例的方法。)时,尝试做一个快速监视的对象从第三方库(来自Infragistics的例如控制。)

First of all, I can't move the yellow arrow in Visual Studio 2010 to step into other lines of code, and also I am getiing exceptions ("Cannot find the method on the object instance.") when trying to do a quick watch on objects from a third party library (controls from Infragistics for example.)

Dim data = My.Computer.FileSystem.ReadAllBytes(file.FullName) Assembly.Load(data)

在使用的Assembly.Load(字符串) ,一切正常,并没有任何问题。

When using Assembly.Load(String), everything works fine, and there are no problems.

Assembly.Load(IO.Path.GetFileNameWithoutExtension(file.Name))

任何想法,为什么的行为是多大的不同?无论如何,以解决这一问题?

Any idea why the behaviour is that much different? Anyway to fix this?

我尝试加载调试符号为我组装的Assembly.Load(byte []的。字节[]),而是试图从第三方库中的调试对象时,我仍然可以例外。

I tried loading the debugging symbols for my assembly with Assembly.Load(byte[]. byte[]), but I still get exceptions when trying to debug objects from third party libraries.

推荐答案

为您装配调试符号没有被加载到应用程序域。当您使用字符串品种,.NET自动查找.PDB沿着您指定的文件名。

The debug symbols for your assembly are not being loaded into the application domain. When you use the string variety, .NET automatically looks for a .PDB alongside the filename you specify.

要加载程序集的和的从字节数组的符号,使用 的Assembly.Load(byte []的,字节[]) ,像这样:

To load an assembly and its symbols from byte arrays, use Assembly.Load(byte[], byte[]), like so:

Dim data = My.Computer.FileSystem.ReadAllBytes(file.FullName) Dim pdbData = My.Computer.FileSystem.ReadAllBytes(pdbFile.FullName) Assembly.Load(data, pdbData)

更多推荐

调试动态加载的程序集

本文发布于:2023-11-13 09:36:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584021.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   程序   动态

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!