Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem getting assemblies list outside class dll
Message
From
06/04/2010 08:00:23
 
 
To
06/04/2010 06:46:55
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01458885
Message ID:
01458890
Views:
48
>I already asked similar question, but still have problem with it
>Let we have class with method
>GetMyAssName()
>
>public string GetMyAssName()
>      {
>            string vbTab = "   ";
>            var usedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
>            foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies())
>            {
>                vbTab = vbTab + "*loc*" + ass.Location + "//";
>            }
>
>            return vbTab;
>        }
>
>If to call this metod inside this class we get some lists of dll s
>Now, let make ddl of thgis class ( class library dll)
>And call this method outside this class in otehr c module
>
>
> DotNetBridgeLib.DotNetBridge oDotNetBridge = new DotNetBridgeLib.DotNetBridge();
>               string  sprp = " " ;
>              
>               sprp = oDotNetBridge.GetMyAssName();
>               
>                Console.WriteLine(sprp);
>
>It prints me only 3 dll - DotNetBridgeLib ( my class dll name with this metod )
>
>C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll
>and
>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
>
> I assumed to see all net dll libraries list like we see in net reflector
>This is propably because my class needs only these 2 libraries.
>Whet NET reflector does to get assembly list?
>If to call method in the same module, where it is, it gives long list of dll s
>Thanks in advance, Vladimir

From help on GetAssemblies():
"Gets the assemblies that have been loaded into the execution context of this application domain"
You may need to load the assembly of interest directly - http://msdn.microsoft.com/en-us/library/25y1ya39.aspx
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform