0

I'm trying to use NGen to speed up the startup/response times for a .Net app. The application compiles (in Visual Studio) and runs happily inside and outside the IDE, but if I 'ngen' the main entry assembly, I get this:

Failed to load dependency BusinessObjects.Enterprise.Sdk of assembly CrystalDecisions.Enterprise.Framework, Version=12.0.1100.0, Culture=neutral, PublicKeyToken =692fbea5521e1304 because of the following error : The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

The referenced Crystal libraries are from the GAC. The ngen command line is:

ngen install "\my_entry_assembly.exe"

Ngen finds most of the depedencies and deals with them, but not the ones above, the only ones that are in the GAC.

What is the explanation, and what can I do about this, short of separately ngenning the assemblies by explicit path to the GAC?

haughtonomous
  • 4,602
  • 11
  • 34
  • 52
  • Either using the wrong bitness, or the wrong framework version of ngen. Make sure you chose the correct version. – leppie Mar 17 '14 at 11:53
  • The bitness is stated in each assembly's metadata isn't it? Can't be the wrong bitness, surely, or the app wouldn't compile and run in the first place. I'm using the .Net 2 ngen - I only have .Net 2/3.5/4 on my machine. – haughtonomous Mar 17 '14 at 11:59
  • The app is explicitly compiled to x86 code so that it runs in Wow64 mode. That works perfectly. – haughtonomous Mar 17 '14 at 12:02
  • It depends on the bitness and framework version of the entry assembly. – leppie Mar 17 '14 at 12:09
  • Which is x86 & .Net 3.5 There is no ngen on my system for .Net 3.5, only a .Net 2 .Net 4 version, found at C:\Windows\Microsoft.NET\Framework\v2.0.50727, – haughtonomous Mar 17 '14 at 12:43
  • .net 3.5 is CLR version 2. – leppie Mar 17 '14 at 12:56
  • Contact Crystal Decisions for support. Surely the google hits I recommended you'd review mentioned that ngen makes cold start times *slower*??? It doubles the number of files that need to found. – Hans Passant Mar 17 '14 at 13:41
  • It slows down the Windows cold start to completion of login (if I do the ngen process as part of that), but it speeds up the subsequent cold start of the application in question, no doubt. However we have abandoned the ngen approach for the moment. – haughtonomous Mar 18 '14 at 14:15

0 Answers0