应用程序是否可以加载.Net dll的NativeImage和JIT版本?(Is it possible for an application to load both NativeImage and

编程入门 行业动态 更新时间:2024-10-14 00:32:20
应用程序是否可以加载.Net dll的NativeImage和JIT版本?(Is it possible for an application to load both NativeImage and JIT version of .Net dll?)

我正在调查我们发布的应用程序的一些小型转储。 我无法在本地重现这些崩溃,但是对于大量报告我注意到加载的dll列表包括regular和.ni。 一些WPF dll的版本。

在VS 2010的“模块”窗格中,例如PresentationCore(在此处格式化)

PresentationCore.dll C:\ Windows ... \ PresentationCore.dll - 已加载符号。 C:\用户\ PresentationCore.pdb PresentationCore.ni.dll * C:\ Windows ... \ PresentationCore.ni.dll - 找不到匹配的二进制文件。 PresentationFramework.Aero.dll * C:\ Windows ... \ PresentationFramework.Aero.dll - 找不到匹配的二进制文件PresentationFramework.Aero.ni.dll * C:... \ NativeImages ... \ PresentationFramework.Aero.ni.dll - 找不到匹配的二进制文件

基本上,它看起来好像我们正在加载NativeImage和JIT版本。 这可能吗?

我在本地计算机上检查了已发布产品的负载,Visual Studio仅列出了模块窗格中加载的单个版本。 此外,Fusion报告NativeImage版本的加载没有错误,我假设是通常的警告:

警告:不会在LoadFrom上下文中探测本机映像。 原生图像只能在默认加载上下文中进行探测,就像使用Assembly.Load()一样。

据我所知,我们不使用LoadFrom来引用这些二进制文件,所以...

有没有理由我在我的callstack中看到NativeImage和普通Dll的混合? 这是正常的吗? 不知道这是否会导致问题,你是否建议任何方法来防止这种情况发生?

I am investigating some minidumps for our released application. I am unable to repro these crashes locally, but for a large number of reports I'm noticing the list of loaded dll's includes both regular and .ni. versions of some WPF dlls.

From the 'Modules' pane of VS 2010, eg PresentationCore (formatted here)

PresentationCore.dll C:\Windows...\PresentationCore.dll - Symbols loaded. C:\Users...\PresentationCore.pdb PresentationCore.ni.dll *C:\Windows...\PresentationCore.ni.dll - No matching binary found. PresentationFramework.Aero.dll *C:\Windows...\PresentationFramework.Aero.dll - No matching binary found PresentationFramework.Aero.ni.dll *C:...\NativeImages...\PresentationFramework.Aero.ni.dll - No matching binary found.

Basically, it looks as if we are loading both the NativeImage and a JIT version. Is this possible?

I've checked a load of our released product on my local machine, and Visual Studio only lists a single version loaded in the modules pane. Additionally, Fusion reports no errors on load of the NativeImage versions, just what I assume is the usual warning:

WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().

As far as I know, we don't use LoadFrom to reference these binaries, so...

Is there a reason I am seeing a mix of NativeImage and normal Dll's in my callstack? Is it normal? Any idea if this could be causing issues, and do you recommend any methods for preventing this from happening?

最满意答案

似乎应用程序可以加载多个版本。 我重写了插件加载以使用直接“加载”而不是“LoadFrom”,并将插件目录添加到应用程序的探测路径。 在此之后,Fusion Logger显示GAC和NI目录之间没有重复。

http://msdn.microsoft.com/en-CA/library/823z9h8w(v=vs.80).aspx

不幸的是,由于交换机引入了不稳定性而我无法获得干净的负载,因此我无法得到关于此要点(减少启动时间)的真实答案。 我现在还原了这个改变,如果我设法让事情干净利落,我会用结果更新答案。

It seems that it is possible for the application to load multiple versions. I rewrote the plugin loading to use a straight "Load" rather than "LoadFrom", and added the plugin directory to the probing path for the application. After this Fusion Logger showed no more duplicates between GAC and NI directories.

http://msdn.microsoft.com/en-CA/library/823z9h8w(v=vs.80).aspx

Unfortunately, I was unable to get a real answer on the main point of this (reduce startup time) as the switch introduced instability and I couldn't get a clean load. I reverted the change for now, if I manage to get things loading cleanly I'll update the answer with the results.

更多推荐

NativeImage,dll,电脑培训,计算机培训,IT培训"/> <meta name="description&q

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

发布评论

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

>www.elefans.com

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