NGEN images are not created in time - Advanced Installer Community
Zsolt Kollarits
Posts: 409
Joined: Fri May 29, 2015 10:36 am

NGEN images are not created in time

Dear Advanced Installer Support,

We are trying to generate NGEN native images on you Assemblies tab for certain DLLs. For that we enabled the "Generate native image for private assembly." checkbox for those DLLs, also clicked on Configure next to the label and set the Installation Platform to 64-bit native image. That's all, we did not modify anything else, all the other settings on that dialog are the defaults.

After intalling our installer we noticed that the NGEN images where not created as the “.Net Runtime Optimization Service” was not running, hence the items where queued, but not created. I had to manually run “C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe executeQueuedItems” to have this executed. Do you have any recommendation how could we force our installer to create dthe NGEN images immediately?

Thank you.

Best regards,
Zsolt
Catalin
Posts: 7849
Joined: Wed Jun 13, 2018 7:49 am

Re: NGEN images are not created in time

Hello Zsolt,

To be quite honest with you, I wasn't really familair with the .NET Optimization Service, but I got the grasp of it after doing a bit of research.

From what I can see, it looks like this is by default not running and it's somehow scheduled to run at specific times (when it does run, it is quite obvious as it's said to eat quite a lot of resources).

That being said, I think the only way would be to manually run your command at the end of the installation?

For instance, we could use a "Launch File" custom action and pass the required parameters to ngen.exe.

Or, another way would be to try and manually enable the service ourselves before the installation of the files (not quite sure how to do this, to be honest).

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”