Created
September 16, 2016 19:04
Some quick code to show assembly name, version, and load path in Program.cs of AspNet Core
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
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