NGen Issue - System.dll



I am POCing NGen for our application to help improve startup times on
slightly older hardware.

I have run into a bit of a snag with regards to System.dll. As it is a
dependency of many of our assemblies, the native version of System.dll is
necessary. It appears that System.ni.dll exists in the NGen cache, but for
some reason when the load is attempted it fails to "resolve" to the native
image, subsequently causing our application native image loading to fail.

A little background... Our application consists of multiple .Net processes.
I am attempting to NGen them one at a time to see if there is any
perceivable performance gain. One thing that I have not done *yet* is
adjusted the assembly base addresses. We have hundreds of assemblies, what
is the best way to approach this? I understand that until this is completed,
the full potential of NGen may not be realized. Correct?

Also, the assemblies of our application that I am NGening are *not* in the
GAC. Some are, but the majority of them *are not*, and they live in their
installed "Program Files/blah/bin" directory.

Here is a sample fusion log of the System.dll issue I am seeing. I have
adjusted the assembly names (Assembly1,2,3) and paths for security reasons.


*** Assembly Binder Log Entry (3/11/2009 @ 3:45:27 PM) ***

The operation failed.
Bind result: hr = 0x80004005. Unspecified error

Assembly manager loaded from:
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files\blah\my.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = me
LOG: DisplayName = Assembly1, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/blah/
LOG: Initial PrivatePath = Bin;
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : Assembly2, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null.
===
LOG: Start binding of native image Assembly1, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null.
LOG: IL assembly loaded from C:\Program Files\blah\Bin\Assembly1.dll.
LOG: Start validating native image Assembly1, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null.
LOG: Start validating all the dependencies.
LOG: [Level 1]Start validating native image dependency System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: Dependency evaluation succeeded.
LOG: [Level 1]Start validating native image dependency mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: Dependency evaluation succeeded.
LOG: [Level 1]Start validating IL dependency System.Xml, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089.
LOG: Dependency evaluation succeeded.
LOG: [Level 1]Start validating IL dependency Assembly3, Version=2.2.3.3,
Culture=neutral, PublicKeyToken=2d978e351d7e49ba.
LOG: Dependency evaluation succeeded.
LOG: Validation of dependencies succeeded.
LOG: Start loading all the dependencies into load context.
LOG: Loading of dependencies succeeded.
LOG: Bind to native image succeeded.
Native image has correct version information.
Native image loaded at base address 08f20000 rather than preferred address:
31000000
Attempting to use native image
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\Assembly1#\963ffd9ebef6923143119a4911cb3642\Assembly1.ni.dll.
Rejecting native image because dependency
C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll is
not native
Discarding native image.


Thank you for the help!
.



Relevant Pages

  • Re: WebServices and getting FileNotFoundException
    ... There might be some other dependency that is not available. ... app to help you debug the assemblies that are being loaded or that have ... > application that communicates with our business tier through Web Services. ... > sounds like a permissions problem as running as SYSTEM grants many more ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: WebServices and getting FileNotFoundException
    ... There might be some other dependency that is not available. ... app to help you debug the assemblies that are being loaded or that have ... > application that communicates with our business tier through Web Services. ... > sounds like a permissions problem as running as SYSTEM grants many more ...
    (microsoft.public.dotnet.framework)
  • Re: WebServices and getting FileNotFoundException
    ... There might be some other dependency that is not available. ... app to help you debug the assemblies that are being loaded or that have ... > application that communicates with our business tier through Web Services. ... > sounds like a permissions problem as running as SYSTEM grants many more ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: URGENT | Framework version problem
    ... > Error: The dependency 'Managers, Version=1.0.2130.17591, ... > to the run directory because it would conflict with dependency ... assemblies. ... assemblyfileversion to crank up the fileversion number with each build. ...
    (microsoft.public.dotnet.framework)
  • Re: 70-305 Test Question
    ... >> Which of the following tools can be used to install an assembly into the ... >> installs it into the native image cache area of the GAC. ... > assume they mean the GAC where uncompiled assemblies go. ...
    (microsoft.public.cert.exam.mcsd)

Loading