Determine if assembly is part of framework

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

Is there any way to determine through code if a given assembly is part of
the .NET Framework? Any special attributes, etc? I saw one suggestion about
checking the key the assembly was signed with, but this appears to differ
between assemblies.

Thanks,

Scott
 
One thing you can do at first is to check whether the assembly is in the
GAC. Assembly.GlobalAssemblyCache will help you to do this. All .Net
framework assemlies are in GAC, while most application assembly won't be
installed into GAC.
However, it won't really resolve your problem, because a user assembly
could be installed into GAC too.

What you can do, is to create a list of names of the assemblies in the .NET
framework, and use this table to match the real assembly name. However,
you will spend some time to generate that list. I think you can get those
names from scanning an install package of the .net framework. It should be
a MSI package, which is actually a small database, where you can find
tables containing what you want.

Thanks
Lifeng
MS VB team
 
Back
Top