From a299149cf7ce3d0fa363fd53840dcf41bf794125 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 25 Jul 2018 10:39:16 +0300 Subject: Improved log manager referenced assemblies listing. --- Software/Visual_Studio/Tango.Logging/LogManager.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Tango.Logging') diff --git a/Software/Visual_Studio/Tango.Logging/LogManager.cs b/Software/Visual_Studio/Tango.Logging/LogManager.cs index c0a8409ef..7d339d6b6 100644 --- a/Software/Visual_Studio/Tango.Logging/LogManager.cs +++ b/Software/Visual_Studio/Tango.Logging/LogManager.cs @@ -216,9 +216,16 @@ namespace Tango.Logging { String log = "--------------------- Referenced Assemblies --------------------------" + Environment.NewLine + Environment.NewLine; - foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) + string codeBase = typeof(LogManager).Assembly.CodeBase; + UriBuilder uri = new UriBuilder(codeBase); + string path = Uri.UnescapeDataString(uri.Path); + String folder = Path.GetDirectoryName(path); + + foreach (var file in Directory.GetFiles(folder,"*.dll")) { - log += a.GetName().Name + ", v" + a.GetName().Version + Environment.NewLine; + FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(file); + string version = fvi.ProductVersion; + log += Path.GetFileNameWithoutExtension(file) + ", v" + version + Environment.NewLine; } log += Environment.NewLine + "--------------------- --------------------- --------------------------"; -- cgit v1.3.1