npolyak / NP.Roxy

Roxy IoC container and Code Generator
Apache License 2.0
8 stars 4 forks source link

incorrect AssemblyResolve handler #2

Open LucaGanio opened 6 years ago

LucaGanio commented 6 years ago

the assembly resolver in CoreBase.cs simply returns TheGeneratedAssembly, while it should check if the requested assembly is actually that one. i.e. your code should be rewritten like this:

return this.TheGeneratedAssembly.FullName == args.Name ? this.TheGeneratedAssembly : null;

returning null is important to let the framework call other handlers.

I stumbled on this problem because after calling GetInstanceOfGeneratedType I encountered a lot of FileLoadException when referencing or trying to load framework assemblies.

npolyak commented 6 years ago

sorry for the delay dealing with it. I am very busy now. Will try to take a look at it next weekend. Regards.

npolyak commented 6 years ago

Thanks for bringing it up. I resolved it in github, but not yet in the nuget packages.