ConfuserEx obfuscated DLL crashes VS 2017 when referenced

900 Views Asked by At

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?

1

There are 1 best solutions below

1
user8555433 On

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.