Search code examples
visual-studio-2010.net-2.0redgatesmartassembly

Smart Assembly - Apply build time obfuscation


I'm writing application, it's near end, and i want to apply obfuscation over my code using smart assembly, and if possible signing too...

the problem is my application is multi-part, and more importantly one of it's part is service based, and it should be install using MSI setup project to work, and i cant first build, and then package it, so i need to do a build time obfuscation thing, so all Class Library Project, and Service and User Interface perform obfuscation in build time, and once they are prepared, the MSI can package them... the way it should, so every one will be happy...

i hear that there's configuration that allow Smart assembly do this in build time, but i dont know how to do it :-s


Solution

  • Technically, the assembly has to be built before SmartAssembly can process it - it works with Intermediate Language code and therefore can't be processed until after compilation.

    However, I don't think this is an issue - ultimately you just want the build output obfuscated before it gets packaged into an MSI. So if you wanted this to happen automatically, you can edit the vsproj to include a SmartAssembly post-build step: http://www.red-gate.com/supportcenter/Content/SmartAssembly/help/6.7/SA_UsingSmartAssemblyWithMSBuild

    If you are using MS Setup and Deployment Projects to build the MSI, the important change to make is to point your SmartAssembly input and output at the /obj folder because for some strange reason, Microsoft is taking the assemblies from /obj as opposed to the more-conventional /bin.