Simple assembly loading?

G

Guest

I've tried loading an assembly (from the application directory) via a simple
name only, but can't. I continually receive System.IO.IOException. The
basic code is below, it seems to be some sort of security issue

thanks,
-Ivan

Assembly a = null;
AssemblyName an = new AssemblyName();
an.Name = "MainWindow";

try
{
a = Assembly.Load(an);
//a = Assembly.LoadFrom("MainWindow.dll");
}
catch (System.IO.FileNotFoundException ex)
{
MessageBox.Show("FileNotFoundException");
}
catch (System.IO.IOException ex)
{
MessageBox.Show(ex.Message);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top