Get Assembly Name

Sometimes you are asked to get/find Assembly name of a class.

You can use below code to get/find Assembly Name in VB.Net,
Dim assembly As System.Reflection.Assembly = System.Reflection.Assembly.GetAssembly(GetType(Class1))
Response.Write(assembly.GetName().Name)



You can use below code to get/find Assembly Name in C#,
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(Class1));
Response.Write(assembly.GetName().Name);


Here in above code Assembly.GetAssembly Method gets the currently loaded assembly in which the specified class is defined.

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete