Skip to content

Instantly share code, notes, and snippets.

@OdeToCode
Created September 16, 2016 19:04
Show Gist options
  • Save OdeToCode/2217a57aad632ed18f1ad2a4c67edcf6 to your computer and use it in GitHub Desktop.
Save OdeToCode/2217a57aad632ed18f1ad2a4c67edcf6 to your computer and use it in GitHub Desktop.
Some quick code to show assembly name, version, and load path in Program.cs of AspNet Core
var assemblies = Assembly.GetEntryAssembly().GetReferencedAssemblies();
foreach (var assembly in assemblies)
{
Console.WriteLine($"{assembly.Version} {assembly.Name}");
var codebase = Assembly.Load(assembly).CodeBase.Replace("file:///", "");
Console.WriteLine($"\t{Path.GetDirectoryName(codebase)}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment