yck1509 / ConfuserEx

An open-source, free protector for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
3.56k stars 1.62k forks source link

System.BadImageFormatException: Could not load file or assembly 'XXX' or one of its dependencies. The module was expected to contain an assembly manifest. #402

Closed asianati closed 8 years ago

asianati commented 8 years ago

Hi,

I have a project which uses reflection to find all referenced assemblies in the main app exe file: Assembly theAssembly= theAssembly = Assembly.ReflectionOnlyLoad(referenceAssemblyfullName);

this code works without any problem if the assemblies are not obfuscated, but after obfuscating the assemblies, I got this exception: System.BadImageFormatException: Could not load file or assembly 'XXX' or one of its dependencies. The module was expected to contain an assembly manifest.

How can I fix this issue? Thanks

ConfuserEx v0.6.0 is used Protection settings: Presets to maximum, No Meta data protection, No resource protection, no name protection

yck1509 commented 8 years ago

Hi, You may want to try aggressive preset instead. Maximum preset tends to cause some incompatibility with reflection.

asianati commented 8 years ago

Thanks. It solved the problem