Dynamic Assembly Loading

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

Guest

I'm currently recieving an IOException when trying to dynamically load a DLL
from my application directory. What specifics do I need to specify (i.e.
version, PublicKey, Culture, etc...) to successfully load the file?

thanks,
Ivan
 
Note that I've tried with and without the version and culture stuff....

Assembly a = null;
AssemblyName an = new AssemblyName();
an.Name = "MainWindow";
an.Version = new Version("1.0.0.0");
an.CultureInfo = new System.Globalization.CultureInfo("neutral");

try
{
a = Assembly.Load(an);
}
catch (System.IO.FileNotFoundException ex)
{
MessageBox.Show("FileNotFoundException");
}
catch (System.IO.IOException ex)
{
MessageBox.Show(ex.Message);
}
 
Back
Top