How to know the location of the assembly where it is being loaded from?

When there are multiple versions of the same assembly exist in the machine, it is very easy to get confused about where is the assembly being loaded in a reflection call. Here is a code snippet which can tell you where the the assembly coming from.


Comments (2)

  1. Phil Bolduc says:

    If the assembly is in the GAC, I believe this could throw a security exception.

  2. Gong Cheng says:

    Maybe, at least when i was the administrator, this piece of code succeeded!