Try this:

List<string> asmNames = new List<string>();
// If called by a method defined in a class in FooBar
foreach (Assembly asm in
System.Reflection.Assembly.GetCallingAssembly().GetReferencedAssemblies(
))
   asmNames.Add(asm.FullName);


// Kristofer

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Knowlton,
Gerald F.
Sent: den 2 juli 2007 17:25
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] Looking for technique

Greeting all;

    I'm looking for some pointers (clues for me) on how to discover what
DLL's a windows application will use when executed. 

For example;

I have an application called FooBar. What I want to do is to be able
(through code embedded in the application) to find the name(s) of all
the dll(s) that FooBar will call when it is executed and place those
names in a collection.

The Dll's that I am interested in are the ones I made a reference to in
the source code.

I was first thinking "Reflection", but it doesn't appear so after some
investigation. 

Perhaps I should investigation deeper ???

I just know this is probably very easy to do and I'm going to kick
myself once someone gives me a clue.


Best regards,


Jerry Knowlton
View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to