Question Portability

wilko

Member
Joined
Jan 7, 2011
Messages
6
Programming Experience
1-3
Hi all, i'm new to this forum so go easy lol.

I'm using VBExpress2010 and have just completed a personal application, which is basically just a front end for a load of db tables and a launcher for other regularly used 3rd party programs. Anyway, i'm looking to make this application portable, by which i mean i want to be able to use it off of my USB Thumb Drive on any Windows computer regardless if which framework the machine has installed. So, i'd like to include .net4 files my app uses on the drive with the exe and get the exe to use these copies rather than go off into Windows looking for them!

Does anyone know if this can be achieved, and if so, how would i go about doing it??

Thanks for reading.
Wilko
 
No, it cannot be achieved. It's better to do your homework sooner rather than later. .NET applications require the appropriate version of the .NET Framework to be installed, plain and simple. That's what makes them .NET apps.

The .NET Framework is much more than just a class library. One of the primary components is the Just In Time (JIT) compiler. When you build your project, the EXE output is not binary code as it is for C/C++ applications. The EXE has a binary header that Windows can run and that redirects to the .NET Framework. The rest of the assembly is MSIL, which is low-level, platform-independent instructions. The JIT compiler then compiles that MSIL to native code just in time to be executed, which is where it gets its name. If there's no .NET Framework installed then there's no JIT compiler, so your app can be compiled so it can't be run.

There are tools around that will compile a .NET app to native code before deployment, but I'm not aware of any free ones and doing so kind of defeats the purpose of using .NET in the first place, although you do still get the simplicity of development.
 
Back
Top