Oh. ok , i was assuming there was a microsoft way to do this. Like
looking it up by the public token or by doing gacutil /resolve :) i
looked at the reflector just briefly , but am not sure this will
resolve it backwards to the exe that points to it.
Ollie Riches - 15 Oct 2005 17:20 GMT
I can think of two way to check which assemblies are loaded:
Either via visual stduio .net using the 'module' window when debugging the
application. The module window can be found at the menu Debug -> Windows ->
Modules
or
In code using reflection , something like this:
sing System;
using System.Reflection;
namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Assembly entryAssembly = Assembly.GetEntryAssembly();
AssemblyName[] assemblyNames = entryAssembly.GetReferencedAssemblies();
for(int i = 0; i < assemblyNames.Length; i++)
{
Console.WriteLine(assemblyNames[i].FullName);
}
Console.ReadLine();
}
}
}
HTH
Ollie Riches
IOn code using reflec
> Oh. ok , i was assuming there was a microsoft way to do this. Like
> looking it up by the public token or by doing gacutil /resolve :) i
> looked at the reflector just briefly , but am not sure this will
> resolve it backwards to the exe that points to it.
Peter Rilling - 17 Oct 2005 05:55 GMT
Okay, do you want to know what something references, or do you want to know
what something is referenced by? Also, do you want to know at runtime
through code or just run some tool at the command line?
There is no "backwards" in assemblies. For instance, if you have Foo.exe
which references Bar.dll, well, you can open Foo.exe with reflector and it
will tell you that Bar.dll is referenced. However, Bar.dll could also be
referenced by MyCoolProgram.exe. Do, as you can see, there can be no
relationship back from the assembly.
> Oh. ok , i was assuming there was a microsoft way to do this. Like
> looking it up by the public token or by doing gacutil /resolve :) i
> looked at the reflector just briefly , but am not sure this will
> resolve it backwards to the exe that points to it.
BR@dontmail - 18 Oct 2005 22:32 GMT
Yes, i was looking for a relationship back from the assembly dll
Thanks anyway