다음을 통해 공유


Determining the Referencing Assembly

Say you're debugging your application and you see that version 1.0 of an assembly is being loaded when you thought it should be version 2.0. Where is the reference to 1.0 coming from?

The easiest way to find out is to look at the Fusion log for this bind. If the version 1.0 assembly was successfully loaded, use the ForceLog/"Log all binds" option of FusLogVw. Then, look for the line in the log showing the calling assembly:

Calling assembly : referencingAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=12ab3bf24c56c45b.

It shows the display name of the calling assembly when available. It doesn't tell you whether this is a static or a dynamic reference because Fusion doesn't know or care (that doesn't matter for binding purposes). So, this could mean that referencingAssembly was built against the other 1.0 assembly, or that it asked for it at runtime via Assembly.Load(), etc.

Sometimes the calling assembly is not specified in the log. There are a few possible cases where that happens:

  • The assembly was requested by unmanaged code (interop).
  • The calling assembly was in another appdomain (AppDomain.CreateInstance(), etc.).
  • The calling assembly had not been loaded through Fusion (Assembly.Load(byte[]), Assembly.LoadFile(), etc.).

Comments

  • Anonymous
    November 27, 2003
    The comment has been removed
  • Anonymous
    December 01, 2003
    The owner of this code said that this means that user code called into an IJW dll without its managed part being loaded in the current appdomain. It's hard to tell more without your callstack at the time of the exception.