Our requirement is being able to integrate our DLLs with ClickOnce. Dotfuscator does the obfuscation job nicely but the obfuscated DLLs cannot be deployed with ClickOnce on customer side. On our side, we can handle it perfectly. Moreover, the obfuscated assemblies sometime crash our .NET CF app. It turns out to a solution that creates a temporary source and obfuscates it before compiling with VS. This ensures that the compiled assembly can be integrated with ClickOnce and fully compatible with .NET CF. What is the best tool to obfuscate C# SOURCE CODE (not assemblies)?
{SmartAssembly} - Simple, efficient, brilliant and comes with more than just obfuscation.
We currently use it with ClickOnce and it supports the Compact Framework - You just add a post build script and you're done. It also has various levels of security, so you can simply go by trial and error to the most compatible level of protection.
You don't need to obfuscate the source code, you just need an assembly obfuscator which supports ClickOnce. Crypto Obfuscator supports this - it performs the obfuscation as part of the build process, so the assemblies that end up being in the ClickOnce manifest and setups are already obfuscated.
In most cases, if you're asking this question, you're using the wrong language (and framework). Many of the things that make .NET powerful are incompatible with obfuscation, so you might as well be using native C++.
ClickOnce might be an exception to this, but I think it still will severely limit the obfuscation level you can use.
If you really want to protect your IP, you should host a web service so your proprietary code never leaves your computer. Once your code is running on someone else's CPU, you've lost the battle to hide it.