Created
January 13, 2012 12:23
-
-
Save keithbloom/1605849 to your computer and use it in GitHub Desktop.
ReferencedAndLoadAssemblies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void AssemblyLoad_tests() | |
{ | |
// Display information about the EXE assembly. | |
var a = Assembly.GetExecutingAssembly(); | |
Console.WriteLine("Assembly identity = {0}", a.FullName); | |
Console.WriteLine("\tLocation = {0}\n", a.Location); | |
// Display the set of assemblies our assemblies reference. | |
Console.WriteLine("Referenced assemblies:"); | |
foreach (var an in a.GetReferencedAssemblies()) | |
{ | |
Console.WriteLine("\tName={0}, Version={1}, Culture={2}, PublicKey token={3}", | |
an.FullName, an.Version, an.CultureInfo.Name, (BitConverter.ToString(an.GetPublicKeyToken()))); | |
} | |
Console.WriteLine("\nLoaded assemblies:"); | |
// Display information about each assembly loading into this AppDomain.); | |
foreach (var b in AppDomain.CurrentDomain.GetAssemblies()) | |
{ | |
Console.WriteLine("\tAssembly: {0} {1}", b.FullName, b.Location); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment