Could not load file or assembly exception HRResult: 0x80131044

0

I'm working on a project that I inherited from someone else who is no longer available to assist.

During execution of the application I get the following error

    ************** 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)

From what I can tell though, SysUserInterfaceUtil makes no reference to Jasper.SharedCode. How do I resolve this issue? Do I need to sign Jasper.SharedCode? Is there a way to resolve this without signing Jasper.SharedCode?

c#
asked on Stack Overflow Jul 11, 2018 by Adam Mack

1 Answer

1

If the library is indeed used by some other library you are referencing, the problem could be that strong name bypassing is deactivated. Strong names are bypassed since .NET 3.5.

Check these settings in the registry (depending on your operating system bitness):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework

If the Key AllowStrongNameBypass exists with a value of 0, set the value to 1.

More information on strong name bypassing: https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-disable-the-strong-name-bypass-feature

answered on Stack Overflow Jul 11, 2018 by Markus Dresch

User contributions licensed under CC BY-SA 3.0