Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
BadImageFormatException - The module was expected to contain an assembly manifest
posted

Hello,

We've been using Infragistics WinForms controls for many years and there's been one issue we haven't been able to solve after many version upgrades.  When one of our WinForms applications is running and the user's PC locks up (unrelated to our application) and needs to be powered off, after the system is rebooted there is often an Infragistics DLL that has the first section zeroed out.  In other words, the DLL file itself has had the first initial bytes replaced with all zeros.  When the user then attempts to start the application they get an error similar to the following:

System.BadImageFormatException: Could not load file or assembly 'Infragistics4.Win.UltraWinStatusBar.v18.2, Version=18.2.20182.175, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'Infragistics4.Win.UltraWinStatusBar.v18.2, Version=18.2.20182.175, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb'

The affected DLL is not always UltraWinStatusBar; it can be UltraWinGrid, UltraWinToolbars, or the Win DLL (Infragistics4.Win.v18.2).  The size and timestamp of the file are unchanged.  I'm guessing the part of the file that gets zeroed out is the part that contains the assembly manifest.

The only solution is to re-copy the DLL from another source.  Any suggestions you can offer would be greatly appreciated.

Parents
  • 7535
    Verified Answer
    Offline posted

    Hello Cavin,

    Are you getting this error on all the machines? May I know which version of visual studio and .net framework you are using ?

    I never heard of this scenario/issue before, I did some research about the System.BadImageFormatException and find couple public post talking about corrupted .NET framework versions. I would recommend running a repair or a reinstall of the .Net Framework from Add/Remove Programs.

    Another common source of BadImageFormatException is the bit-ness. By default, .NET uses AnyCPU nowadays, which means it will use 64-bit if available, and 32-bit otherwise. It's possible that one of the projects uses 32-bit while the other uses 64-bit,

    https://stackoverflow.com/questions/31344410/system-badimageformatexception-using-net-2-0

    If this will not help then please provide the clear steps, you environment and I will try to reproduce the issue at our environment for further investigation.

Reply Children
No Data