2

I have a collection of assemblies using reflection. I want to loop through them, but I would like to ignore the .NET framework or ASP.NET framework DLL's. Is there an attribute on the assembly that marks that its from the .NET framework? Or any other designation?

I was looking at the name, and if the name of the assembly starts with System, Microsoft, or mscorlib, I am ignoring it. But I was wondering if there is a flag I can use to make this even easier?

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
Brian Mains
  • 50,520
  • 35
  • 148
  • 257
  • Related: http://stackoverflow.com/questions/52134/determining-if-an-assembly-is-part-of-the-net-framework/3666403#3666403 (Will let @Brian decide if duplicate and/or if VTC makes sense here) – Ruben Bartelink Mar 19 '11 at 23:35

2 Answers2

3

Does the "GlobalAssemblyCache" property qualify for your requirement? http://msdn.microsoft.com/en-us/library/system.reflection.assembly.globalassemblycache.aspx

Propably also depends on how you are loading your assemblies collection. If the above mentioned suggestion doesn't work for you, please clarify that.

bonifaz
  • 588
  • 3
  • 16
  • Good approach, but I suspect no; I'm building a third-party library and there could be GAC DLL's I need to inspect, so I would need to include those too. – Brian Mains Mar 20 '11 at 00:11
0

You might find this answer to a related question useful

Community
  • 1
  • 1
Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249