Created
September 16, 2016 19:04
-
-
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
This file contains 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