.netprismintellilock

IntelliLock 1.5 An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)


After ofbuscation in IntelliLock 1.5 one of my dll's prism module stop loading (unity), the error message is: “An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)”

First i had a reference to portable library (.net, Silverlight 4) that hold some shared objects. And the error was something like "Cant load referenced library System.Windows" although there was no UI in portable library and was no reference to System.Windows dll. But after half of a day of tuning IntelliLock and trying to figure out where the problem is, unity begin to fall with "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" error.

First i thought the problem in referencing portable dll. I replace this library with normal .net one, but error is still the same.

I'm using .Net 4 Client Profile. WPF, C#, Prism 4, unity.

Any ideas how to fix it?


Solution

  • We run into similar (??) problem some time ago so I suggest:

    1) Check if all dependencies satisfied. Run DependencyWalker and check that there's no red lines - nothing missing (please read some documentation because sometimes it mark for example IEShims.dll as missing but you don't need it) -- Use correct version of DependecyWalker (x86/x64) on correct comp

    2) As Denis Kucherov already sad: Check how parent and/or child (dependant) object was compiled. Once we tryed to use .NET project compiled by default as 'Any CPU' on x64 bit machine to load by reference C++ DLL compiled for x86 - no go -> exceptions, exceptions, crash...

    3) Hardcore level - Run Process Monitor from Sysinternals and check for any missing/not found errors (if any). It's a loooong list sometimes...

    My guess that DLL you trying to load actually loading ok but it itself depend on some other DLL that not present

    P.S. You mention .Net Client Profile - just try it once with full .NET Framework and check if it helps - if so - double check that .NET Client profile installed in target comp