1

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?

Adam Mack
  • 21
  • 1
  • 2
  • 4
    Possible duplicate of [Windows Forms Error: "A strongly-named assembly is required"](https://stackoverflow.com/questions/290980/windows-forms-error-a-strongly-named-assembly-is-required) – Lucifer Jul 11 '18 at 12:02
  • If the library is not being used, you could remove it from the project's references. – babu646 Jul 11 '18 at 12:06
  • Possible duplicate https://stackoverflow.com/questions/48835342/could-not-load-file-or-assembly-bunifu-ui-v1-5-3-exception-from-hresult-0x80 – Akhil Singh Jul 11 '18 at 12:14
  • You have an old copy of Jasper.SharedCode.dll, it does not yet have a strong name. But the program was built with another version of it that did have a strong name. The mismatch is fatal. Just make sure that the old copy is updated correctly, use Fuslogvw.exe if you have no idea where it came from. – Hans Passant Jul 11 '18 at 12:55

1 Answers1

2

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://learn.microsoft.com/en-us/dotnet/framework/app-domains/how-to-disable-the-strong-name-bypass-feature

Markus Dresch
  • 5,290
  • 3
  • 20
  • 40