Welcome, guest | Sign In | My Account | Store | Cart

Sometimes (working with IronRuby with interactive mode) it's very useful to know what assemblies was loaded. This sample shows how to do it.

Ruby, 10 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#constants
AppDomain = System::AppDomain
Console   = System::Console
#caption of table
Console.WriteLine('{0, 5} {1}', 'GAC', 'AssemblyName')
Console.WriteLine('{0, 5} {1}', '---', '------------')
#print table of loaded assemblies
AppDomain.CurrentDomain.GetAssemblies().each do |i|
  Console.WriteLine('{0, 5} {1}', i.GlobalAssemblyCache, i.GetName().Name)
end