I've used ConfuserEx to obfuscate the code of my DLL but if I use anything other than the minimum level of obfuscation, the DLL crashes Visual studio 2017 a few seconds after I add a reference to it with a 'bad image' exception. The same DLL will however work fine in VS 2013. I want to use the maximum level of obfuscation to protect my code so is there a work around for this? I have searched on Google but have not found a concrete solution to this problem, although others seem to have experienced it. Perhaps there is a setting in VS 2017 that will allow me to use the fully obfuscated DLL without crashing?
Asked
Active
Viewed 858 times
1
-
any solution that worked for you @Damo? – Azaz ul Haq Nov 26 '18 at 08:07
-
No and yes. The DLL I was using is for an automated licence key system called Quantum-key.net so as long as I wasn't in debug mode I could add it at the very end when I was ready to release my software. It would then build fine but I could not debug. If I wanted to debug I would just remove the reference and comment out the lines of code that used it, do the debugging then add the reference and code back in again – Damo Nov 27 '18 at 10:33
1 Answers
0
Usually a bad image format exception...I am assuming...means that the .dll might not be compiled for AnyCpu and you are loading it into a project that is compiled differently. Example: dll was compiled for X86 but your project is compiling to X64. Not sure if that helps.

user8555433
- 71
- 4
-
I confirmed that all DLLs are compiled for AnyCPU but one of them referencing Log4Net.dll. Referencing that DLL makes VS to crash. Any idea why? Log4Net.dll version is 1.2.10 – Azaz ul Haq Nov 26 '18 at 11:12