Click to See Complete Forum and Search --> : how to add reference at run time in C# project


pragadheesh
March 16th, 2009, 01:19 AM
hi all,


how can i add an assembly(dll) as reference in a C# project at run time.?! i need to add a reference at run time.!? i.e normally we add references by Right-Clicking References in Solution Explorer and we can browse for any dll and add it in references. i need to do this using code.


like if i ave a class library(dll) in "C:\Documents and Settings\Pragadheesh\My Documents\Visual Studio 2005\Projects\qwerty\qwerty\bin\Debug\qwerty.dll"

i need to add this dll as reference to my project. how can i do this at run time.?


thanks in advance.

Shuja Ali
March 16th, 2009, 03:38 AM
You will need to add use reflection. Take a look at this article
http://www.codeguru.com/csharp/csharp/cs_syntax/reflection/article.php/c5881