1

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?

Denis Kucherov
  • 369
  • 3
  • 15
  • 1
    This might be the target platform, try compiling them all explicitly x86 or x64. – Adam Houldsworth Apr 17 '12 at 08:38
  • Yes i know this, all assemblies is x86. And no problems before obfuscate this particular dll. – Denis Kucherov Apr 17 '12 at 08:45
  • I think you need to go to Intellilock for support - it sounds like a bug in their obfuscator. Unless someone has seen this specific problem before I doubt we'd be able to help you. – Rup Apr 17 '12 at 08:49
  • I already send this issue to support, but usually they didn't answer questions. :) Only hope that someone had the same problem. – Denis Kucherov Apr 17 '12 at 08:54
  • If you're a customer and they don't answer your questions then that's pretty shoddy support. You might not be their highest priority but they should still acknowledge your email and give you a time-frame for getting back to you. I'd chase them for a response, maybe even phone them to check they're looking into it for you. – Rup Apr 17 '12 at 11:41
  • Yep, I am their customer for about 3 years and 2 versions of IntelliLock, but never get even an answer for support. May be that guys dont like write letters or my english so bad, I don know :). – Denis Kucherov Apr 17 '12 at 13:15
  • I have a little progress with my issue. After i replace some warnings (throw exception form property) in my assembly it starts to load after obfuscation. But if i use portable assembly the same error is appears. – Denis Kucherov Apr 17 '12 at 13:16
  • All assemblies that reference to portable dll have this warning "Warning 35 CA0060 : The indirectly-referenced Silverlight assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. Silverlight reference assemblies should be specified with the '/reference' switch." – Denis Kucherov Apr 17 '12 at 13:18

2 Answers2

1

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

Alex F
  • 3,180
  • 2
  • 28
  • 40
1

as Rup suggested, this was entirely a InTelliLock bug. I managed to overcome it just with disabling lock settings for some libraries. The good new is that problem was in locking logic not in obfuscation. It took a few days to fix problem.

I still dont have any answer from support team, and as said before i'm actually did not expect it.

Denis Kucherov
  • 369
  • 3
  • 15