I have full name of assembly. I don't know is it referenced, custom or GAC library, the only information is its name. Assembly.Load/LoadFile/LoadFrom
these methods work only if searched library is in folder where project runs. If library is GAC library, then it arises exception like "Could not load file or assembly 'gac_library_name' or one of its dependencies. The system cannot find the file specified"
. I can solve this problem by finding path to GAC library, then load it. But is there any way to load any library using only its name?
P.S. there are several questions related to this, but they work for libraries if it's in same folder of project runs. For GAC libraries I couldn't find anything.
Asked
Active
Viewed 503 times
0

Javidan
- 566
- 1
- 9
- 25
-
1"System library" doesn't mean anything, the .NET Framework assemblies are stored in the GAC so can always be found. You should accommodate the way the CLR finds assemblies and just copy the DLL into the same folder as the EXE. Or put it in the GAC as well. You can invoke DLL Hell by implementing AppDomain.AssemblyResolve – Hans Passant Feb 12 '14 at 12:31
-
thank you for clarification. I've already understood my mistake. – Javidan Feb 12 '14 at 12:33
1 Answers
1
If you trying load and assembly from GAC, you should use its full name (include version, culture etc.)
Here is related question: C#: How to load assembly from GAC?