How can we help you today? How can we help you today?

Smart Assembly 8 is obfuscating .NET core 8 project dlls but app wont launch after obfuscation ?

We migrated to Smart Assembly 8 to obfuscate .NET Core 8 project dlls.
After obfuscation, we faced below issues
1) The application would not launch even with first basic level of obfuscation when all dlls were obfuscated.
2) We did a check which dll files on obfuscation would allow the application to work.
Few of them allowed app to launch but failed when further application had to navigate and load the other obfuscated dlls.
Without obfuscation the app works.
We set basic obfuscation
 <Obfuscation FieldsNameMangling="1" NameMangling="1" />
PradnyaN
0

Comments

1 comment

  • Jon Kirkwood
    Official comment

    Hi PradnayaN, 

    Thanks for reaching out on the Redgate forums.

    This sounds like an issue with obfuscating assemblies that are involved in reflection, dependency injection, or are entry points. 

    We recommend starting with minimal obfuscation settings and excluding the main assembly and any shared contracts or reflection-heavy code to ensure runtime stability.

     

    Here are some initial steps to try first to see if you can clear your issues with obfuscation

    • Don't Obfuscate Entry Point or Shared Contracts
      Exclude:

      • Program.dll or main project.
      • Any shared interfaces or base class libraries (used in reflection or dependency injection).
      • DTOs, gRPC contracts, Razor components, etc.

      ➜ Use [DoNotObfuscate] or SmartAssembly project file filters.

    • Turn Off Type/Method Renaming for Reflection-Heavy Code
      If you use:

      • Dependency Injection
      • Reflection
      • JSON serialization/deserialization
        ➜ Obfuscated names won’t match expected strings.

      Fix: Add [Obfuscation(Exclude = true)] or exclude via SA project rules.

    • Assembly Load Failures?
      If your app dynamically loads assemblies, you must not obfuscate public types or names unless explicitly handled.

      ➜ Check AppDomain.AssemblyResolve or plugin patterns.

    • Use Debug Logs or Fusion Log Viewer
      Might help to catch missing method/assembly load failures.
    • Minimal Working Obfuscation

      Start with:
      <Obfuscation NameMangling="0" FieldsNameMangling="0" />

      Then incrementally raise levels after testing that the previous setting worked. 

    Jon Kirkwood

Add comment

Please sign in to leave a comment.