dynamic assembly

  • Thread starter Thread starter Urs
  • Start date Start date
U

Urs

Hi,

I enumerate all assemblies in the application domain. How can I decide if
one is a dynamic assembly?

Urs
 
Hi Urs,

Thanks for your post. As I understand, you use AppDomain.GetAssemblies to
gets the assemblies that have been loaded into this application domain, and
you want to know which assemblies are loaded dynamically. Please correct me
if there is any misunderstanding. Now I'd like to share the following
information with you:

I suggest to use Reflection to check the assemblies which are referenced
statically, and the rest are loaded dynamically. Please take a look at
ManifestResourceInfo.ReferencedAssembly property:

ManifestResourceInfo.ReferencedAssembly Property
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemReflectionManifestResourceInfoClassReferencedAssemblyTopic.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Huang,

Yes you understood my problem correct
Unfortunately I'dont understand the usage of
ManifestResourceInfo.ReferencedAssembly property.
Do you have an example?

Thanks, Urs
 
Hi Urs,

Thanks for your response. Please refer to the following code snippet which
get a list of referenced assmeblies of currect assembly:

Assembly myAssembly = Assembly.GetCallingAssembly();
AssemblyName[] arReferencedAssemblies =
myAssembly.GetReferencedAssemblies();
foreach ( AssemblyName ar in arReferencedAssemblies)
Console.WriteLine(ar.FullName);

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top