Sign in to follow this  

[.net] ngen.exe

This topic is 4207 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

quick question. If I use ngen.exe to convert a .NET exe to a native can thsat be run on a machine without the .NET framework? eg. Win 98

Share this post


Link to post
Share on other sites
NGen on the MSDN

Quote:

The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.


NGen pre-compiles your .NET application for a specific platform(Thus, if you intend to execute it, do it on the client machine you're installing the app on).

NGen reduces the first startup of the executable, because it doesn't need to compile the .NET executable for the first time and post it in the GAC(Global Assembly Cache). As said before, it still requires the .NET framework because it links to these DLLs for it's functionality. NGen doesn't replace .NET calls with Win32 calls, it just creates the machine code for it.

Therefor, any function called from within your executable to say, the Windows UI, still goes through the System.Windows.Forms namespace.

Toolmaker

Share this post


Link to post
Share on other sites

This topic is 4207 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this