So, from what I understand, it does take an executable/dll file written in MSIL
and does the JIT-job: convert MSIL code to native machine code. Right?
So ran the ngen
to generate a native image of my program using the command:
ngen install myProgram.exe
It take a while but I found the generated file is at C:\Windows\assembly\NativeImages_v4.0.30319_32\myProgram\db1496cf0295bbe6a9242d86c0d8e091\myProgram.ni.exe
But what's exactly the contents of that executable file? a machine code version of my C# program? it doesn't run (see below). if I want to provide to the user a native version of my program, if I run ngen
in each *.exe
and *.dll
and give that generate image files to the user, it will run fine? does it still needs the .NET framework?
However, that generate image doesn't works and give the "This app can't run on your PC" error message.