确定加载的程序集

Nic*_*ick 8 .net dll assemblies winforms

如何确定我的.NET桌面应用程序已加载的所有程序集?我想将它们放在about box中,这样我就可以通过电话查询客户,以确定他们在PC上有什么版本的XYZ.

很高兴看到托管和非托管程序集.我意识到列表会变长,但我打算对它进行增量搜索.

Gre*_*man 12

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);
    }
  }
}
Run Code Online (Sandbox Code Playgroud)