cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rwfrenz20
Level 2

Precompile 64-bit Assembly

I have a 64-bit .NET assembly that I wish to precompile (NGEN) in my InstallScript MSI project. It appears that the compiled MSI attempts to call the 32-bit version of NGEN.exe.

I have verified that "64-bit Component" is set to yes for the component and have also tried setting the path to InstallUtilLib.dll to the 'Framework64' version under Tools->Options->.NET.

After running the MSI, I get nothing in the 64-bit NGEN.log (and nothing in the Native Image Cache). Inspecting the 32-bit NGEN.log I see the following:

[CODE]09/13/2010 10:27:02 [308]: Command line: C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe install C:\Program Files\\core.dll /nologo /silent
09/13/2010 10:27:02 [308]: Uninstalling assembly C:\Program Files\\core.dll because of an error during compilation: Failed to compile C:\Program Files\\core.dll because this image is not a valid Win32 application.
09/13/2010 10:27:02 [308]: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
09/13/2010 10:27:02 [308]: ngen returning 0xffffffff[/CODE]

Can someone point me to the appropriate setting to ensure the assembly is precompiled as 64-bit? According to the documentation this should be controlled via the InstallUtilLib setting, but as you can see that doesn't seem to work.

Thanks,
Ryan
Labels (1)
0 Kudos
(1) Reply
rwfrenz20
Level 2

It appears I can resolve this issue by modifying the 'InstallRoot' property under System Search View. There is a checkbox to search the 64-bit registry for the location of NGEN.exe. Checking this option fixed my problem.

Ryan
0 Kudos