Page 1 of 1

Call .net framework ngen.exe to generate native code

Posted: Fri Nov 25, 2005 9:31 am
by bernaert
Hello,

I would like to call the ngen.exe of the .net framework to generate native applications of my assemblies that I just installed with the installation procedure.
How would I do this in the installation?
How can I get the path to the ngen.exe and how do i launch commands with the ngen.exe on my assemblies as the assemblies can be installed in any directory if the user selects another directory than the default directory?

Thx,
Bernaert Dominique.

Posted: Fri Nov 25, 2005 10:31 am
by sinan
There is already a built in command which generates native images - its called Generate Native Images. So you don't have to worry about locating ngen.exe. Moreover, you can use the $TARGETDIR$ variable to read the folder that is the end-user chosen installation folder at runtime.

Faboulous

Posted: Fri Nov 25, 2005 10:59 am
by bernaert
Faboulous!
This works with the .net 2.0 plugin also?

Thx,
Bernaert Dominique.

Posted: Fri Nov 25, 2005 11:06 am
by sinan
I believe it should - please try it out and let me know if it does not.

Posted: Fri Nov 25, 2005 11:30 am
by bernaert
I think it doesn't.
I've added generation of a native image to one assembly to the installation.
Ran it in a vmware box.
Searched using ngen display to see if there is a native image, and it didn't find one.
Please note that ngen of framework 2.0 must be called with the install parameter and you can call the main executable, it will automatically create native images of all depending assemblies.
It would maybe be usefull to integrate a call to ngen with the uninstall parameter when uninstalling the application.

Thx,
Bernaert Dominique.

Posted: Fri Nov 25, 2005 12:18 pm
by sinan
I'll escalate this to the product team and see what they come back with. Thanks for reporting!

Posted: Fri Nov 25, 2005 12:40 pm
by sinan
This issue has been confirmed. Thank you for reporting. A resolution will shortly be available.