Call .net framework ngen.exe to generate native code

Got a problem you cannot solve? Try here.
Post Reply
bernaert
Posts: 12
Joined: Wed Nov 23, 2005 10:41 am

Call .net framework ngen.exe to generate native code

Post 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.
sinan
Site Admin
Posts: 1035
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post 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.
bernaert
Posts: 12
Joined: Wed Nov 23, 2005 10:41 am

Faboulous

Post by bernaert »

Faboulous!
This works with the .net 2.0 plugin also?

Thx,
Bernaert Dominique.
sinan
Site Admin
Posts: 1035
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

I believe it should - please try it out and let me know if it does not.
bernaert
Posts: 12
Joined: Wed Nov 23, 2005 10:41 am

Post 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.
sinan
Site Admin
Posts: 1035
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

I'll escalate this to the product team and see what they come back with. Thanks for reporting!
sinan
Site Admin
Posts: 1035
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

This issue has been confirmed. Thank you for reporting. A resolution will shortly be available.
Post Reply