如何确定我的.NET桌面应用程序已加载的所有程序集?我想将它们放在约框中,这样我就可以通过电话查询客户,以确定他们在PC上使用的XYZ版本.
很高兴看到托管和非托管程序集.我意识到列表会很长,但我打算对它进行增量搜索.
- using System;
- using System.Reflection;
- using System.Windows.Forms;
- public class MyAppDomain
- {
- public static void Main(string[] args)
- {
- AppDomain ad = AppDomain.CurrentDomain;
- Assembly[] loadedAssemblies = ad.GetAssemblies();
- Console.WriteLine("Here are the assemblies loaded in this appdomain\n");
- foreach(Assembly a in loadedAssemblies)
- {
- Console.WriteLine(a.FullName);
- }
- }
- }