确定是否GAC'ed和放大器; NGen'ed组件正在使用 [英] Determine if GAC'ed & NGen'ed assemblies are being used

查看:195
本文介绍了确定是否GAC'ed和放大器; NGen'ed组件正在使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何确定是否正在没有装载verifing的程序集的签名在运行时,甚至使用GAC'ed组件?使用本地图片

How do I determine if the Native images are being used without the Loader verifing the signature of the assembly at runtime, or even using the GAC'ed assembly?

我有,我们正在尝试用NGEN但是目前我们正在运行的,所有的DLL被定位,由于大量的后期绑定的依赖,看着进程资源管理器的文件夹中的EXE复杂的系统,它看起来像本地人图像被使用,但我怎么能肯定我得到的全部利益,并消除了装载机确认步骤?

I have complex system that we're experimenting with NGen but currently we're running the exe from the folder where all the DLL's are located due to a lot of late binding dependencies, looking at Process Explorer, it looks like the Native images are being used, but how can I be sure I'm getting the full benefit and eliminating the Loader Verification step?

干杯, 格雷姆。

更新: 我收到很多此类的程序集绑定日志查看器的事情:

Update: I'm getting lots of this sort of thing from the Assembly Binding Log viewer:

LOG: [Level 1]Start validating IL dependency MyCompany.Entities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7cd8595f4671c5dd.
LOG: Dependency evaluation succeeded.

,并在年底

LOG: Validation of dependencies succeeded.
LOG: Start loading all the dependencies into load context.
LOG: Loading of dependencies succeeded.
LOG: Bind to native image succeeded.
Native image has correct version information.
Attempting to use native image C:\Windows\assembly\NativeImages_v2.0.50727_32\MyCompany.Mylibrary#\4710bb8309419d707681bd360088181f\MyCompany.MyLibrary.MyClass.ni.dll.
ZAP: Native image has been relocated.
Native image successfully used.

所以它使用本机的图像,但仍核实他们,即不采用GAC的版本,即使这就是我的,像这样创建本机映像:

So it's using the Native images but still verifying them, i.e. not using the GAC version even though that's where I created the Native image from, Like so:

ngen install "MyCompany.Entites, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7cd8595f4671c5dd, processorArchitecture=MSIL"

脚注: 该文章似乎在暗示,如果不从GAC加载的程序集则验证过程将抵消NGEN优势? CLR内到外 - 提高应用程序启动性能(MSDN)

Footnote: This articles seems to imply that if the assemblies are not loaded from the GAC then the verification process will offset the NGen advantages? CLR Inside Out - Improving Application Startup Performance (MSDN)

更新 - 作为Nobugz指出在下面留言,是不是因为3.5 SP1看执行上面提到的验证步骤:的 MSDN文档上NGEN

Update - As Nobugz has pointed out in a comment below, the verification step mentioned above is not performed since 3.5 SP1 see:MSDN Docs on NGen

推荐答案

您可以很容易地从Fuslogvw.exe工具看到它。从Visual Studio命令提示符启动它。与日志类别=本机映像进行配置,设置+记录所有绑定到磁盘。运行程序。回到fuslogvw,刷新。它会告诉你被加载的所有程序集的列表。

You can easily see it from the Fuslogvw.exe tool. Start it from the Visual Studio Command Prompt. Configure it with Log Categories = Native Images, Settings + Log all binds to disk. Run your program. Back to fuslogvw, Refresh. It will show you a list of all assemblies that got loaded.

双击一个条目,看看大会得到了怎么装。如果它来自海关总署,你会看到:

Double-click an entry to see how the assembly got loaded. If it came from the GAC, you'll see:

日志:IL汇编从C加载:\ WINDOWS \组装\ GAC_MSIL \ blahblah

LOG: IL assembly loaded from C:\Windows\assembly\GAC_MSIL\blahblah

如果该NGEN-ED映像使用,你会看到:

If the Ngen-ed images was used, you'll see:

日志:绑定到本机映像成功

LOG: Bind to native image succeeded.

这篇关于确定是否GAC'ed和放大器; NGen'ed组件正在使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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