VS2012 and Click Once deployment after Obfuscation

Jan 3, 2013 at 1:49 PM

I am a newbe to Confuser and after some initial teething troubles have managed to Obfuscate some C# code with system DLL's The code is compiled using Dot Net framework 4.0. If I obfuscate the output files the results are placed in a Bin/release/confused directory. If I copy the code to the release directory then try to publish. The copies are replaced by newly created compiled code and the final published code is for all intents easily read using ILspy. I Have checked the Obfuscated code and that is not readable.

How do I get VS2012 to publish the obfuscated code?  

Nov 1, 2013 at 6:32 AM
Edited Nov 2, 2013 at 3:57 AM
Good day,

I was asking almost the same thing here. https://confuser.codeplex.com/discussions/464209

I would just like to ask if you figured it out?

For me, I am currently using a manual process. By the way I'm using VS2010.

Here's what works for me.
  1. Click the Publish Wizard..\Publish Now button on your project properties.
    This will automatically build your project on Debug/Release folder. I use it since it also creates the files used in ClickOnce. We will use those files later.
  2. Open Confuser and Drag-Drop files On the Debug/Release folder that you want confuser to work on.
    This will create a Confused folder (using the default output directory settings) with the obfuscated assemblies.
  3. Copy all dependencies/files (if any) required by your project to run to the just create "Confused" folder.
    You project should now work with the obfuscated assemblies. I ran the program just to make sure. :D
  4. Copy the .manifest file from your Debug/Release folder to the Confused folder and Edit it using MageUI.
  5. On the "Files" section of MageUI, locate the Confused folder(may already be selected) and check the option to put .deploy on your files and click "Populate".
    Your project files would be renamed to *.deploy
  6. Save the .manifest file and sign it with the *TemporaryKey.pfx created when you published your project (This should be on your project folder).
  7. Copy the .application file from your Debug/Release folder to the Confused folder and Edit it using MageUI.
  8. On the "Application Reference" section of MageUI Click "Select Manifest.." and select the .manifest file you saved on step 6.
  9. Save the .application file and sign it with the *TemporaryKey.pfx.
  10. Lastly, this maybe optional, just copy the setup.exe and the publish.html files on publish folder to the Confused folder.
Your Confused folder should now work like a published ClickOnce Folder.

This is the first time a made a step-by-step so forgive me if some instructions may not be very descriptive.

Dec 17, 2013 at 2:51 AM
Thanks a lot for those steps rscataran! I'll have to give this a go :)