Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get Reflection To Work

Status
Not open for further replies.
Jan 19, 2000
57
US
I am attempting to use reflection to load a dll on the fly. The dll in question is sitting in a directory named C:\MyAssemblies. I have added a reference to the dll in my project, and have specified the "Copy to local" option as false. The point is to be able to use the dll with dozens of programs, needing only modify the single dll if a change is required. The strange thing is, I got this to work the first day I tried it, now I'm completely stumped. I keep receiving the following error:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'MyAssembly3, Version=2.0.0.0, Culture=neutral, PublicKeyToken=755b0617700642ba' or one of its dependencies. The system cannot find the file specified. File name: 'MyAssembly3, Version=2.0.0.0, Culture=neutral, PublicKeyToken=755b0617700642ba' at Reflection_Test.Module1.Main()

Any ideas?
 
You shouldn't need reflection to do this. You just need to add the assembly to the GAC. Your application will always look in the executing folder for the resource first, then the GAC second.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top