c# - 无法加载文件或程序集异常 HRResult: 0x80131044
问题描述
我正在从事一个项目,该项目是我从无法再提供帮助的其他人那里继承而来的。
在执行应用程序期间,我收到以下错误
************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly 'Jasper.SharedCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
File name: 'Jasper.SharedCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at SysUserInterfaceUtil.GridPopUpMenu.DoExport(String fileName, ExportTypes exportType)
at SysUserInterfaceUtil.GridPopUpMenu.exportXML_ItemClick(Object sender, ItemClickEventArgs e)
at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarButtonItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarItemLink.OnLinkClick()
at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
据我所知,SysUserInterfaceUtil 没有引用 Jasper.SharedCode。我该如何解决这个问题?我需要签署 Jasper.SharedCode 吗?有没有办法在不签署 Jasper.SharedCode 的情况下解决这个问题?
解决方案
如果该库确实被您引用的某个其他库使用,则问题可能是强名称绕过已停用。自 .NET 3.5 起绕过强名称。
检查注册表中的这些设置(取决于您的操作系统位数):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework
如果 KeyAllowStrongNameBypass
存在且值为0
,则将值设置为1
。
有关强名称绕过的更多信息:https ://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-disable-the-strong-name-bypass-feature
推荐阅读
- android - Android BLE 广告 UUID 长度在不同的 SDK 级别上有所不同?
- holoviews - hvplot 热图排序轴
- sql - 如何使用 PL/SQL 中的过程在表中搜索记录?
- c++ - 如何将静音音频数据写入音频流?
- javascript - React-Native 中更快的数组循环
- go - 如何在 Go 中创建多级错误子类型
- javascript - 在 Hexo 中实施分类法(分组类别)的正确方法是什么?
- powershell - 范围标头必须使用适当的属性或方法
- c# - Web应用程序中的会话变量丢失
- python-3.x - 如何在没有重复的情况下找到矩阵中点之间的所有距离?