views:

177

answers:

2

I know there are tools like Salamander that can compile a .NET WinForms apps to fully native code with no need for the CLR/.NET Framework to be on a machine. Is this possible for WPF apps as well?

+1  A: 

According to this page, Salamander supports .NET Framework 3.5, which would suggest that WPF is supported.

That being said, I've yet to see a tool like this that supports WPF well. There is much in WPF that is handled via runtime object metadata.

In addition, trying to avoid the need to install the CLR typically causes more problems than it solves. Having the CLR installation be a requirement should not be a problem, especially now, for any reasonable application.

Reed Copsey
Well I'm also concerned about reverse engineering, which is so easy with MSIL vs. native code.
Rhubarb
@Rhubarb: In this case, I'd use an obfuscator, instead of trying to go to native code. The metadata is what makes reverse engineering easier - and there are very good decompilers for native code. A good obfuscator raises the bar enough that I personally wouldn't worry about it, and doesn't "break" WPF...
Reed Copsey
What are some good decompilers for native code?
Rhubarb
Hex-Ray's IDA-Pro works for most things: http://www.hex-rays.com/idapro/ There are some other ones out there, if you search... It's all about raising the bar, since nothing makes it impossible...
Reed Copsey
It seems native + obfuscation would beat MSIL + obfuscation, am I wrong?
Rhubarb
Depends. Native + Obfuscation is probably a bit tougher to decompile... However, it's also slower to develop. Much of the power and flexibility of .NET comes from having the metadata available, though - so giving that up (which happens if you go native) has some dramatic disadvantages. In specific, expect it to completely break WPF - since WPF uses TypeDescriptors everywhere...
Reed Copsey
A: 

You can also take a Viewmodel approach with the WPF logic all mapped through to native business logics with command and property binding using C++/CLI, as I described in a presentation last year.

Andy Dent