views:

690

answers:

3

Hello there,

Is it possible to deploy a .NET 2.0 application as a portable executable? So that my program can be ran in a Flash Disk without the .NET Framework 2.0 installed in the target machine. Or maybe is it possible to distribute my program with the required .NET DLLs, so that no framework installation is necessary?

I know that there are some alternative tools to turn my .NET exe into a single native executable like RemoteSoft Salamander, Xenocode Postbuild, and Thinstall, but unfortunately I can't afford one.

I also tried to embed the dependencies with Mono's mkbundle, but it messed my program up =\ (no XP visual style, broke some controls and its functionality)

Any kind of help would be appreciated :)

Thanks.

fyi: my IDE is Microsoft Visual C# 2008 Express Edition with .NET Framework 2.0 as the target framework.

+8  A: 

No; you need either the framework installed, or the tools like you have mentioned.

You could potentially look at mono's new static linker, but that is about it...

Marc Gravell
+8  A: 

Well, other than things like Salamander and Thinstall (now VMWare ThinApp) you would have to have .NET installed if you really want to run .NET.

It may be possible to run Mono without actually installing it (not statically linking your program, but including Mono on the flash drive). I suspect it would be tricky though, as you'd have to tell the runtime about things like the GAC location.

I can't see anything in the Mono FAQ about this, but you might want to ping a Mono mailing list - it sounds like a potentially interesting and useful thing to be able to do.

Jon Skeet
+1  A: 

Well Thinstall is very expensive and it doesn't work in all situations. If you want to run your app without .Net installed you might run into trouble although there are tools that do that Xenocode has a tool that can do this for you and it's cheaper than thinstall.

But if you ask my opinion it's a bad idea to use them. Better convince your target market to install .Net 2 (Which is pretty much universal these days), and then pack all of your library files into one file using a cheaper Obfuscator like tool (There's a good one from Smartassembly.)

I've used Thinstall for a long time, and I've worked on this technology a lot, so I am not shooting off without experience.

Cyril Gupta