4.2 Some .NET specifics


During the compilation phase, a new file Hello.exe is created. Although it may seem so, remember that this particular 'executable' is unlike the other .exe files that are created using a conventional non-.NET compiler (such as Visual Studio 6 or the ancient Turbo C++). This .exe file is a .NET assembly “ it can only run if the .NET framework has been installed on the local machine. If you copy HelloWorld.exe to another Windows PC which does not have the .NET framework installed and try to execute it, it will not run.

The .NET framework [2] would have been installed if either of the following had been previously installed:

[2] At the time of writing, the .NET Framework Service Pack 2 has been released. This takes care of some security issues and should be downloaded and set up after the .NET framework has been installed. Get it from http://msdn.microsoft.com/netframework/downloads/updates/sp

  • Visual Studio .NET

  • .NET Framework SDK

  • dotnetfx.exe (.NET Framework installer)

  • a .NET application which has been distributed together with the .NET framework together as one package. [3]

    [3] Using VS .NET, it is possible to 'package' a .NET application together with the whole .NET framework for distribution. Needless to say, this inflates the whole distribution but gives the client the convenience of having to obtain and install the .NET framework separately. A .NET EXE needs the .NET framework to run.

A .NET assembly (which is usually post-fixed with a .exe or .dll file extension) is actually IL code bundled together with a manifest file. [4] Remember that a .NET assembly is quite different from a normal Windows DLL or EXE file though the file extensions can be the same.

[4] The assembly manifest contains some information (metadata) about the assembly itself such as the methods it contains, and even a hash value of the contents of the assembly. It is quite unlike the manifest.mf file in a Java .jar file “ the assembly manifest contains so much more information.



From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net