如何启用程序集绑定日志记录? [英] How can I enable Assembly binding logging?

查看:556
本文介绍了如何启用程序集绑定日志记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到:无法加载文件或程序集'Bla'或其依赖项之一.试图加载格式不正确的程序."

I'm getting, "Could not load file or assembly 'Bla' or one of its dependencies. An attempt was made to load a program with an incorrect format."

详细信息的一部分说:

"WRN:程序集绑定日志记录已关闭. 若要启用程序集绑定失败日志记录,请将注册表值[HKLM \ Software \ Microsoft \ Fusion!EnableLog](DWORD)设置为1. 注意:程序集绑定失败日志记录会带来一些性能损失. 要关闭此功能,请删除注册表值[HKLM \ Software \ Microsoft \ Fusion!EnableLog]."

"WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]."

因此,我认为这可能使我对上面的错误有所了解(也许下一个YSOD将包含有关失败原因的更明确的信息),我导航到注册表中的该位置,但是有我看不到这样的密钥.它的功能是:

So, thinking this may give me some insight in why I'm getting the error above (maybe the next YSOD would contain more explicit information about exactly why it's failing), I navigated to that location in the registry, but there is no such key that I can see. What it does have is:

\Fusion 
    (Default)   value not set
    \GACChangeNotification
    \NativeImagesIndex
    \PublisherPolicy

我想念什么?

推荐答案

开始研究任何失败的绑定的好地方是使用"fuslogvw.exe"实用程序.这可能会为您提供与绑定失败有关的所需信息,这样您就不必弄乱任何注册表值来打开绑定登录.

A good place to start your investigation into any failed binding is to use the "fuslogvw.exe" utility. This may give you the information you need related to the binding failure so that you don't have to go messing around with any registry values to turn binding logging on.

Fuslogvw MSDN页面

该实用程序应该位于您的Microsoft SDKs文件夹中,具体取决于您的操作系统,该文件夹应为以下内容: "C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v {SDK版本} A \ Bin \ FUSLOGVW.exe"

The utility should be in your Microsoft SDKs folder, which would be something like this, depending on your operating system: "C:\Program Files (x86)\Microsoft SDKs\Windows\v{SDK version}A\Bin\FUSLOGVW.exe"

1)运行此实用程序(具有GUI),并将设置设置为将失败的日志绑定到磁盘".

1) Run this utility (it has a GUI) and set the settings to "Log bind failures to disk".

2)单击全部删除"以清除以前所有绑定失败的列表

2) Click "Delete all" to clear the list of any previous bind failures

3)在您的应用程序中重现绑定失败

3) Reproduce the binding failure in your application

4)在实用程序中,单击刷新.然后,您应该会在列表中看到绑定失败.

4) In the utility, click Refresh. You should then see the bind failure logged in the list.

5)您可以通过在列表中选择绑定失败并单击查看日志"来查看有关绑定失败的信息

5) You can view information about the bind failure by selecting it in the list and clicking "View Log"

我要寻找的第一件事是应用程序寻找程序集的路径.您还应该确保所讨论的程序集的版本号是您期望的版本.

The first thing I look for is the path in which the application is looking for the assembly. You should also make sure the version number of the assembly in question is what you expect.

这篇关于如何启用程序集绑定日志记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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