Could not load file or assembly for already loaded addin

View: New views
2 Messages — Rating Filter:   Alert me  

Could not load file or assembly for already loaded addin

by Andy Selvig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi-

I'm trying to use Mono.Addins with Castle ActiveRecord (object
relational mapping system). Part of using ActiveRecord is calling the
ActiveRecordStarter.RegisterAssemblies() method on an assembly that
contains models to map. When I try to do this on an assembly that has
been loaded with Mono.Addins, I get a "Could not load file or
assembly" exception. It gets raised on an internal call to
Assembly.Load().

I don't know why it's trying to load the assembly even though I know
it's already been loaded. But that said, I understand the exception
since the assembly is not located in the application's bin directory
(it's in a separate addin directory). So, my question is, how can I
make the .NET/Mono runtime know where to look for this assembly and/or
have it available from Assembly.Load()?

Any help would be appreciated.

Thanks.

-Andy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Mono.Addins" group.
To post to this group, send email to mono-addins@...
To unsubscribe from this group, send email to mono-addins+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/mono-addins?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Could not load file or assembly for already loaded addin

by Lluis Sanchez-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


El dg 18 de 10 de 2009 a les 19:22 -0500, en/na Andy Selvig va escriure:

> Hi-
>
> I'm trying to use Mono.Addins with Castle ActiveRecord (object
> relational mapping system). Part of using ActiveRecord is calling the
> ActiveRecordStarter.RegisterAssemblies() method on an assembly that
> contains models to map. When I try to do this on an assembly that has
> been loaded with Mono.Addins, I get a "Could not load file or
> assembly" exception. It gets raised on an internal call to
> Assembly.Load().
>
> I don't know why it's trying to load the assembly even though I know
> it's already been loaded. But that said, I understand the exception
> since the assembly is not located in the application's bin directory
> (it's in a separate addin directory). So, my question is, how can I
> make the .NET/Mono runtime know where to look for this assembly and/or
> have it available from Assembly.Load()?

You can load the assembly using Assembly.LoadFrom(), providing the full
path to the assembly.

Lluis.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Mono.Addins" group.
To post to this group, send email to mono-addins@...
To unsubscribe from this group, send email to mono-addins+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/mono-addins?hl=en
-~----------~----~----~----~------~----~------~--~---