Using the System.Reflection to get the Assembly Name and Details

 

The name of an assembly consists of four parts:

1. The short name. On Windows this is the name of the PE file without the extension.
2. The culture. This is an RFC 1766 identifier of the locale for the assembly. In general, library and process assemblies should be culture neutral; the culture should only be used for satellite assemblies.
3. The version. This is a dotted number made up for 4 values — major, minor, build and revision. The version is only used if the assembly has a strong name (see below).
4. A public key token. This is a 64-bit hash of the public key which corresponds to the private key used to sign[1] the assembly. A signed assembly is said to have a strong name.

To get all these details during the run time we use the help of System.Reflection classes.
Below find the code to get all these details.

Method
-----------

using System.Reflection; // Import the name space . This is the key component to get the details of an assembly during run time

// Add the below code on page load or some other events

Assembly myAssembly=Assembly.LoadFrom(Server.MapPath(@"Bin\NHibernate.dll"));
String result=myAssembly.FullName;
Response.Write(result); // See the result here