tags:

views:

58

answers:

3

I use Antlr tools as follows (on Mono)

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

I reference two dll's, but there is another dll file (antlr.runtime.dll) that is referenced behind the scene. I got this when I have an error just copying two dlls and compile.

Are there any .NET tools to detect what dll's are referenced? For example, if I run 'DETECT Antlr3.Runtime.dll', I get 'antlr.runtime.dll'.

+1  A: 

You can use Reflector. (Recursively expand the References node)

SLaks
Why was this downvoted?
SLaks
+3  A: 

Give NDepend a go. It has a dependency graph/dependency matrix feature that lets you explore dependencies between DLLs.

Anna Lear
+1  A: 

You could use Reflector or write one using Mono.Cecil (NDepend use this)

Example using Mono.Cecil

In a new project, reference 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);
      }
    }
  }
}
madgnome
@madgnome : Could you elaborate your answer? Just compiling your code gives me errors. Thanks.
prosseek
@prosseek: I've updated my code to work with the version of Mono.Cecil that i've linked.
madgnome