Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# .NET
Hi,
I want to load dll dynamically .But without adding the reference of the dll ,to avoid my C# application to load the dll from a particular place only.
 
Because due to following reason -
- i'm installing a software & it generates some dlls in it's installation folder.
- Hence if installed multiple versions of same software, then maultiple versions of this dll will be generated in their respective installation folder.
 
- so my requirement is that, my C# application'll decide from which location the dll need to loaded if multiple software installation is there(as above)
 
so everything will be happen at runtime.

PLease guide me soon.
 
Thanks
Posted 15-Jan-13 2:21am
Edited 15-Jan-13 3:06am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

To answer to the question itself: use Assambly.Load[^], see: Using Reflection to load unreferenced assemblies at runtime in C#[^]
 
But:
1) the framework has it's mechanism to locate assamblies, see: http://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.100).aspx[^]
2) you can bind the reference to the assambly with strong name, thus, the versions could simply coexist in gac
3) There are plugin frameworks you can use
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100