Any tools to detect all referenced dll.NET

I use Antlr tools as follows (on Mono)

dmcs /r:Antlr3.Runtime.dll /r:StringTemplate.dll * .cs /out:Main.exe

I refer to two dll libraries, but there is another DLL file (antlr.runtime.dll) that is referenced behind the scene. I got this when I have an error by simply copying two dll libraries and compiling.

Are there any .NET tools to detect dll references? For example, if I run "DETECT Antlr3.Runtime.dll", I get the file "antlr.runtime.dll".

+3
source share
3 answers

Reflector , Mono.Cecil (NDepend )

Mono.Cecil

Mono.Cecil

using System;
using Mono.Cecil;

namespace ReferenceDetector
{
  class Program
  {
    static void Main(string[] args)
    {
      var assemblyPath = args[0];
      var assemblyDefinition = AssemblyFactory.GetAssembly(assemblyPath);
      Console.WriteLine(assemblyDefinition.Name.FullName);
      foreach (AssemblyNameReference reference in assemblyDefinition.MainModule.AssemblyReferences)
      {
        Console.WriteLine("\t" + reference.FullName);
      }
    }
  }
}
+2

NDepend a go. / , DLL.

+3

You can use Reflector . (Recursively expand node links)

+1
source

Source: https://habr.com/ru/post/1769172/