Ngen newbie questions?

  • Thread starter Thread starter gouqizi.lvcha
  • Start date Start date
G

gouqizi.lvcha

I am using ngen to generate native image for an assemly, the document
said the native image should be installed into "native image cache",
does anyone know where is "native image cache",
it should be a different directory of GAC, right?

I am not sure If a native image an IL or not? Can run under a
computer without .Net Framework?
 
I am using ngen to generate native image for an assemly, the document
said the native image should be installed into "native image cache",
does anyone know where is "native image cache",
it should be a different directory of GAC, right?

In a directory called NativeImages<CLRVersion> under
%windir%\assembly. You can see it if you navigte there from a command
prompt, but in Explorer its content will be displayed meged with the
GAC by the Fusion shell extension.

Can run under a computer without .Net Framework?

No it can't.


Mattias
 
In a directory called NativeImages<CLRVersion> under
%windir%\assembly. You can see it if you navigte there from a command
prompt, but in Explorer its content will be displayed meged with the
GAC by the Fusion shell extension.

Mattias, Thank you. I followed your suggestions, found several
directories: GAC, GAC_32, GAC_MSIL, NativeImage_v2.0.50727_32, I am
wondering what's the difference between these directories.
No it can't.

Can I convert a IL to windows executable which is independent of .Net
Framework?
 
Mattias, Thank you. I followed your suggestions, found several
directories: GAC, GAC_32, GAC_MSIL, NativeImage_v2.0.50727_32, I am
wondering what's the difference between these directories.

Can I convert a IL to windows executable which is independent of .Net
Framework?

You can not convert a .NET application to a non-.NET application.

You can, however, purchase products that bundle what you need of the
..NET runtime into a single executable.

These products are not cheap, nor foolproof.

Here are some of them:
http://www.xenocode.com, price is $499 for single developer
http://www.remotesoft.com/linker/, price is $1249 for single developer

As you can see, these solutions are pricy.
 
You can not convert a .NET application to a non-.NET application.

Just navigate the tool you mentioned below http://www.xenocode.com, it
has a tool called Postbuild .NET Obfuscator which seems can directly
merging in Framework dependencies and converting managed executables
into x86-based native executables. But this solution is pricy,
wondering if there is free version can do it?
 
Mattias, Thank you. I followed your suggestions, found several
directories: GAC, GAC_32, GAC_MSIL, NativeImage_v2.0.50727_32, I am
wondering what's the difference between these directories.

All that begin with 'GAC' are used for the GAC, obviously. IIRC in
v1.x of the framework there was only the single 'GAC' directory.
Assemblies compiled for v2.0 go into one of the three bitness specific
GAC directories ('GAC_MSIL', 'GAC_32' or 'GAC_64') depending on their
target platform (compare with the C# compiler's (Csc.exe) /platform
switch).

The NativeImage directories are for the NGEN cache.


Mattias
 
ilmerge is an (unsupported ?) Microsoft tool and does a good job for merging
assemblies into a single assembly. I use it for combining my interop
assemblies and it works like a charm. But of course it's still dotnet.
 
Back
Top