mkaring / ConfuserEx

An open-source, free protector for .NET applications
https://mkaring.github.io/ConfuserEx/
MIT License
2.38k stars 370 forks source link

Adding constants obfuscation causes mscorlib 4.0.0.0 dependency in class libraries that already reference 2.0.0.0 #522

Open thetawave opened 1 year ago

thetawave commented 1 year ago

Steps to Reproduce:

  1. Make class library with framework listed
  2. Add a string constant
  3. Add the following to cs file [assembly: Obfuscation(Exclude = false, Feature = "+constants(mode=normal,elements=SNI,cfg=false)")]// causes mscorlib 4 dep
  4. Compile without confuserEx
  5. Note via dnspy mscorlib 2.0.0.0 is referenced
  6. Compile with MSBuild + confuserEx
  7. Note via dnspy mscorlib 4.0.0.0 is referenced

This causes problems for class libraries used as plugins in some systems. I expect simple string obfuscation to not change mscorlib dependencies.