Loading Assemblies

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The following code when run generates a file not found exception:
AssemblyName aName = new AssemblyName();
aName.Name = "Martee.Entity";
Assembly assembly = Assembly.Load(aName);

on the other hand, this runs OK:
Assembly assembly = Assembly.LoadWithPartialName("Martee.Entity");

Martee.Entity is in the GAC, but Load doesn't seem to be able to find it.
I'd rather not use LoadWithPartialName because it's obsolete, but I'm not
sure what to replace it with. Can anyone suggest something?
 
Not really familiar with loading assemblies at runtime, but can't you just
copy the Martee.Entity to your local bin/executable folder?
 
Back
Top