recently I was looking for a .NET Obfuscator. I found Obfuscar, but it doesn't meet all my conditions. I found ConfuserEx 2 to be the best choice. However, I ran into some issues while trying to obfuscate my .NET 6 assembly.
What I have tried:
- Obfuscating the output dll assembly. The problem is that I always get an error specifying that I'm missing some depencies and I don't know, how can I fix this. I tried adding modules, that are missing, but I still got some errors (in publish, i added all libraries starting with System.* - awful solution, I know).
Exception: dnlib.DotNet.TypeResolveException: Could not resolve type: System.IO.MemoryStream (System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
[ERROR] Cached assemblies:
[ERROR] ql-lang, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (C:\Users\admin\source\repos\...\bin\Debug\net6.0\app.dll)
[ERROR] System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[ERROR] System.Collections, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[ERROR] System.Console, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[ERROR] System.Linq, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[ERROR] System.Threading.Thread, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Failed at 19:12, 0:00 elapsed.
- I also tried obfuscating published assembly (single executable) - but it reports an error that it isn't a valid .NET assembly.
- And the last thing I tried is obfuscating libraries in the
obj
directory. When I confused the assembly (dll) in theobj
, it was working, but in runtime, it always throw an exception that some other win32 native depency is missing.
Thank you in advance for helping me with this. Also, please, don't recommend me any other obfuscator as I need it as free, then for commerical use (without license).