URGENT : GetTypes in assembly??

  • Thread starter aerge calderara
  • Start date
A

aerge calderara

dear all,

I am using the GetTypes method of an assembly object in
order to check that it implement a particular needed
interface for my application.

system.Reflexion.Assembly.LoadFrom(sFile).GetTypes was
working fine until today where I get an error saying that
all type in assembly cannot be loaded.

Without changing anything I get this error any idea why
and how can I avoid it?

Thnaks for your information
regards
serge
 
J

Jon Skeet [C# MVP]

aerge calderara said:
I am using the GetTypes method of an assembly object in
order to check that it implement a particular needed
interface for my application.

system.Reflexion.Assembly.LoadFrom(sFile).GetTypes was
working fine until today where I get an error saying that
all type in assembly cannot be loaded.

Without changing anything I get this error any idea why
and how can I avoid it?

Is there any InnerException in the exception thrown by GetTypes()?
 
L

Leon Lambert

I had a similar problem. In my case i had multiple dlls in the same
folder as dependancies. These were referenced and used in the dll i was
reflecting. I did an Assembly.LoadFrom for each of these files then it
worked. Would have been nice if Assembly.LoadFrom would load the main
dll and all its dependancies but i could not figure out how to make it
do that.

Hope this helps
Leon Lambert
 

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