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);
}

RE: Simple assembly loading? by Ivan

Ivan
Tue Jul 18 22:01:01 CDT 2006

Opps, I didn't mean to post this question twice!

"Ivan" wrote:

> 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);
> }