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

Project fails to obfuscate via Visual Studio build, obfuscates via UI but will not execute

We have around 10 executables that we are obfuscating during the Visual Studio build process all but one succeeds resulting in .NET 8.0 dlls that have their dependencies either merged or embedded into the resulting dll. The one that is not working appears to run just fine through Visual Studio and does not produce any kind of error message. When I look at the obfuscated dll after completion using ILSpy it has not been obfuscated nor have any of the dependencies been merged or embedded. The resulting dll produced by SmartAssembly is just a copy of the non-obfuscated dll that was used as the source assembly, they are the exact same size. If I obfuscate using the SmartAssembly UI, then SA produces an obfuscated dll with all dependencies either merged or embedded into it as expected. I have log files from both runs and ILSpy output images from both runs that I would be more that happy to send you. I can also send the SA and C# project files. We have been using SA for years for and have just converted out .NET apps from Framework 4.8 to .NET 8.0. Never had this issue in the past. Like I said the other apps in out suite obfuscate just fine. All the apps have the same code in their project files for performing the obfuscation step.
rick105
0

Comments

1 comment

  • Jon Kirkwood
    Official comment

    Hi rick105,

     

    Thank you for reaching out on the Redgate forums regarding your SmartAssembly concern.

    Interesting that you have a variance between VS build process over running it through SmartAssembly GUI directly. Since your other .NET 8.0 projects obfuscate correctly, here are some things to check:

     

    1️⃣ Compare SA Logs (Build vs. UI) – Check if the build log shows SA skipping obfuscation or using the wrong input/output paths.

    2️⃣ Check the SmartAssembly Project File (.saproj) – Open it in a text editor and compare it to a working one. Make sure dependency merge/embed settings match.

    3️⃣ Investigate MSBuild Process – Run MSBuild /verbosity:diagnostic to see if SA is being invoked properly for this project.

    4️⃣ Check the SA Task in .csproj – Verify that SA is actually being triggered. You might have something like:

    <Target Name="AfterBuild">
      <Exec Command=""$(SmartAssemblyPath)\SmartAssembly.com" /build MyProject.saproj" />
    </Target>

    Try running this command manually to see if it works outside the build.

     

    5️⃣ Check Dependencies – Does this project reference anything different, like native libraries or unmanaged code?

    6️⃣ Rebuild from Scratch – Try a full clean (bin/obj deletion) and test with a fresh SA project file.

     

    If nothing stands out, feel free to share your SA logs and .saproj file so we can investigate further

    I have generated a secure file-link to provide any logs/project files. This link is valid for 14 days.

    https://files.red-gate.com/requests/CHkY0nxjxnmEUmVu8HZACE

    Jon Kirkwood

Add comment

Please sign in to leave a comment.