Assembly class

Assembly class allows us to:

  • Load assemblies
  • Explore metadata and types
  • Create instance of types

Easiest way to load assembly is by load them using following methods :

GetAssembly (requires Type variable)

GetCallingAssembly (returns Assembly from which this method has been called)

These two methods have Assembly return type. After acquiring Assembly variable we can use it to get types that we want using GetType method.

Let’s explore Assembly class:



Type’s class GetProperties method returns us with a array of PropertyInfo objects. Similarly¬†GetProperty method provided with a name of Property returns us a¬† PropertyInfo object. It allows us to access a lot of information and interaction concerning specific property, such as:

Does property have get or set accessor,

Properties Attributes,


Return type,

Allows us to change it’s value.

And so on…

Next time we will continue with MethodInfo class.


© 2021 LearnC#WithDarko

Theme by Anders NorenUp ↑