gvasko
Posts: 33
Joined: Mon Jun 07, 2010 7:11 pm

NGen: The system cannot find the file specified

Hi,

we are trying to use NGen for our assemblies, but it gives the following error in the log:
Action 16:36:04: AI_NativeImageInstall.32C56C03_A6BB_4E63_AE31_F2F522131040.
MSI (s) (08:04) [16:36:04:537]: Executing op: CustomActionSchedule(Action=AI_NativeImageInstall.32C56C03_A6BB_4E63_AE31_F2F522131040,ActionType=3137,Source=BinaryData,Target=GenerateNativeImages,CustomActionData=C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe install "ClassLibNGen, Version=1.0.0.0, Culture=neutral, PublicKeyToken=825f2ed0b2c997c1" /NoDependencies€5000€C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe update /queue)
MSI (s) (08:84) [16:36:04:537]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIC7CE.tmp, Entrypoint: GenerateNativeImages
Executing command :
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe install "ClassLibNGen, Version=1.0.0.0, Culture=neutral, PublicKeyToken=825f2ed0b2c997c1" /NoDependencies
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.18408
Copyright (c) Microsoft Corporation. All rights reserved.
Uninstalling assembly ClassLibNGen, Version=1.0.0.0, Culture=neutral, PublicKeyToken=825f2ed0b2c997c1 because of an error during compilation: The system cannot find the file specified. (Exception from HRESULT: 0x80070002).
The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
The MSI was run using msiexec from an Admin command line. Running the above mentioned ngen command manually, it works well both in the Admin command line and in System context.

Could you help on this, where the problem is?

This log is created by a simple installer: a single assembly is packed into an MSM, which is included in an otherwise empty MSI. Aip and the full log are attached.

Using AI 12.3.1

Thank you,
Gabor Vasko
Attachments
NGenCannotFindFile.zip
(33.36 KiB) Downloaded 458 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: NGen: The system cannot find the file specified

Hello Gabor,

I apologize for my delayed reply, but we were a bit busy lately.

We tested and replicated the behavior. We've started investigating your reported issue and we'll get back to you as soon as we have an update.

Thank you for your patience and understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
gvasko
Posts: 33
Joined: Mon Jun 07, 2010 7:11 pm

Re: NGen: The system cannot find the file specified

Hi Daniel,

Thank you, that's fine.

VG
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: NGen: The system cannot find the file specified

Hello Gabor,

We have investigated this and it seems the issue is cause by the Ngen behavior. It seems Ngen fails to generate the assembly native image during the installation process. Unfortunately, we have tried to further investigate this but we didn't find any info about this strange behavior. We apologize for the inconvenience. As a workaround, you can proceed like this:
1. go to "Assemblies" page and select your added assembly
2. in "Assembly Properties" right pane, under "Type" section click on "Configure" hyperlink
3. in the ".NET Native Image" dialog -> "Installation" section -> "Priority" combo box select the "Generate when the computer is idle" option

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
gvasko
Posts: 33
Joined: Mon Jun 07, 2010 7:11 pm

Re: NGen: The system cannot find the file specified

Hi Daniel,

Yes, it works this way.
We will find out how this behavior affects our product.

Thank you,
Gabor
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: NGen: The system cannot find the file specified

You're welcome Gabor.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”