none
Is it possible my application is loading NativeImage and JIT versions of dll's? RRS feed

  • Question

  • When looking at my application startup with Fusion, I see the same dll seemingly loaded multiple times:

    From the 'default' pane of fusion logger:

    *** Assembly Binder Log Entry  (06/05/2013 @ 6:56:56 PM) ***
    
    The operation was successful.
    Bind result: hr = 0x0. The operation completed successfully.
    
    Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
    Running under executable  F:\src\main\3dswin\bin\x64\Release\3dsmax.exe
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: User = ADS\taylorst
    LOG: DisplayName = PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
     (Fully-specified)
    LOG: Appbase = file:///F:/src/main/3dswin/bin/x64/Release/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = 3dsmax.exe
    Calling assembly : WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: F:\src\main\3dswin\bin\x64\Release\3dsmax.exe.Config
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
    LOG: Version redirect found in framework config: 3.0.0.0 redirected to 4.0.0.0.
    LOG: Post-policy reference: PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    LOG: Binding succeeds. Returns assembly from C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll.
    LOG: Assembly is loaded in default load context.
    

    --------------------------------------------------------------------------------------------------------------

    From the Native pane:

    *** Assembly Binder Log Entry (06/05/2013 @ 6:55:33 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable F:\src\main\3dswin\bin\x64\Release\3dsmax.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = ADS\taylorst LOG: DisplayName = PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified) LOG: Appbase = file:///F:/src/main/3dswin/bin/x64/Release/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = 3dsmax.exe Calling assembly : ManagedServices, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. === LOG: Start validating all the dependencies.
    <log emitted for brevity...>

    LOG: [Level 1]Start validating IL dependency Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Native image has correct version information. LOG: Validation of dependencies succeeded. LOG: Bind to native image succeeded. Attempting to use native image C:\Windows\assembly\NativeImages_v4.0.30319_64\Presentatio5ae0f00f#\b686a51f20097a3a518cdc9d6730c1c2\PresentationFramework.ni.dll. Native image successfully used.

    Is this a problem?  Could it be a glitch in Fusion Logger?  Would this be contributing to a slower startup time?

    Tuesday, May 7, 2013 6:36 PM

Answers

  • Hi Frozen,

    Based on your log, I saw the PresentationFramework have been loaded twice. Am I right?

    And also based on the log, I see nothing wrong. At first, it loads version 3.0, and you have redirect it to 4.0, so, it reload the 4.0 version based on the redirection config. So it is just played as your code.

    And this a few little affect the startup time.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 8, 2013 8:50 AM
    Moderator
  • Hi Frozen,

    >>If the application is loading Dll's twice though, wouldn't that have an effect on performance/startup, and possibly cause conflicts if resources from one dll are used by the other?

    Yes, it is just a little effect on performance/startup. Although it is load twice, but there is still only one reference in an appdomain, so no conflicts.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by FrozenKiwi Tuesday, May 21, 2013 3:30 AM
    Monday, May 20, 2013 5:32 PM
    Moderator

All replies

  • Hi Frozen,

    Based on your log, I saw the PresentationFramework have been loaded twice. Am I right?

    And also based on the log, I see nothing wrong. At first, it loads version 3.0, and you have redirect it to 4.0, so, it reload the 4.0 version based on the redirection config. So it is just played as your code.

    And this a few little affect the startup time.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 8, 2013 8:50 AM
    Moderator
  • Hi Mike

    Thanks for the response.  I managed to pick the one confusing dll though - I have many duplicate load messages.  This case it's due to referencing WPFToolkit, which references the v3 file version.  In the other cases, it appears that the cause is our plugin system, where we load .Net binaries using "LoadFrom". 

    From what I understand, "LoadFrom" will not load NativeImages for the assembly being loaded, but I thought its references would then be loaded in the default "Load" context.  I can't seem to find this statement in the docs now I look for it, but I'm pretty sure I read that somewhere when researching this issue.  Anywho, this doesn't seem to be the case.  I set the probing path, and loaded our plugins in the default "Load" context, and it seemed to clear up a lot of these messages, so it seems that we keep the context when searching for references of dynamically loaded assemblies.  

    Unfortunately, I couldn't see if this had a major effect on our startup time or anything else, because something about the change caused problems with our .Net SDK.  If the application is loading Dll's twice though, wouldn't that have an effect on performance/startup, and possibly cause conflicts if resources from one dll are used by the other?

    For example, we have a noticeable (5s) pause when first accessing some of our WPF-based components.  It looks to me like some at least of that pause is due to JIT'ting PresentationCore etc.  However, these dll's all reside in the NativeImage cache, and are loaded at startup, so perhaps this pause is unnecessary.

    I'd like a bit of a confirmation that what I'm seeing is something worth fixing before I devote the hours to figuring out our Loading issue.  If its possible our plugins, loaded in the LoadFrom context, are causing unnecessary JIT'ting which is introducing pauses into our application, its worth fixing.  If this is just some confusing logging, and I will see no benefit from tinkering with our load, then I'll apply that time elsewhere.

    Monday, May 20, 2013 4:17 AM
  • Hi Frozen,

    >>If the application is loading Dll's twice though, wouldn't that have an effect on performance/startup, and possibly cause conflicts if resources from one dll are used by the other?

    Yes, it is just a little effect on performance/startup. Although it is load twice, but there is still only one reference in an appdomain, so no conflicts.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by FrozenKiwi Tuesday, May 21, 2013 3:30 AM
    Monday, May 20, 2013 5:32 PM
    Moderator
  • Thanks for your help.  I'll continue looking for ways to boost our startup performance then!
    Tuesday, May 21, 2013 3:31 AM