How to load assembly from GAC?

 Posted by SheoNarayan on 5/8/2008 | Category: C# Interview questions | Views: 21932

Lets say you have to load the assembly from GAC on button click event then you should write following method.

protected void btn_Click(object sender, EventArgs e)


AssemblyName asm = new AssemblyName("ClassLibrary1, Version=, Culture=neutral,

Assembly al = Assembly.Load(asm);

Type t = al.GetType("ClassLibrary1.Class1");

MethodInfo m = t.GetMethod("Method1");

str = "reflection - " + (string)m.Invoke(null, null);



For more visit

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response