views:

522

answers:

1

After reading this post and encountering the same issue (when attempting to build the manifests):

MSB3171: Problem generating manifest. Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format.

I would like to know if anyone has had success using .NET Reactor (Encryption/Obfuscation tool) with ClickOnce deployment. I have trawled the net all morning attempting different techniques, and some techniques work with Dotfuscator and Xenocode so I read, but I can't get any love from .NET Reactor.

I really think this message is being received because ClickOnce is attempting to generate a manifest against the encrypted file (of which can't even be opened within .NET Reflector)...

What options do I have here?

+1  A: 

We faced same problem with ClickOnce and .NET Reactor. We refused obfuscation.

Yes, you are correct. ClickOnce need to extract assembly version, its dependencies, manufacturer, etc... from a file. ClickOnce is trying to load an assembly which is no longer the assembly after the obfuscation done. It's a regular binary .exe file now.

There is one awful workaround which worked fine for me, but project management rejected the idea.

Build and obfuscate all your binaries. Pack them to a zip (or whatever) file on the AfterBuild event basis. Mark your zip as "Data file" (Project Settings -> Publish - > Application Files... -> Publish Status -> Data File). After that create single not obfuscated executable (.exe) assembly. Which simply unpacks and runs one of your obfuscated executables. Setup ClickOnce publish deployment for that new executable.

EDIT: please ask if I was not clear enough.

Vasiliy Borovyak