Pages - Menu

nopCommerce Plugin - Reflection error about LoaderExceptions

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Today trying to setup a few build configurations for my multi-tenant projects, so that I can use different web config transformation when working on different projects.

I came to an error complaining about pluginDescriptor.ReferencedAssembly reflection System.Reflection.ReflectionTypeLoadException. The error looks like this.





Solutions

It is basically the reflector try to look up the dlls for reflection and throw exception as dlls are not there.

I quickly went through the build configurations in one of my plugin project Nop.Plugin.Tax.FixedRate and found the following.



The new build configuration "DebugSpeedo" that I just added to the system had a default output path to the bin folder. It looks like the only place had the proper path (that puts the dlls inside the presentation layer for nop) was the "Debug" and "Release" configuration. 

It seems to me that we have to fix up the path for any new custom build configurations that we create. I have changed the output path value for "All Configurations" which hopefully, I will not see this issue again when I create more custom build configurations down the track.

Summary

It is a similar error as to the ones when we first create custom plugins, that we need to fix the output path. Just didn't expect I had to revisit it again.

No comments:

Post a Comment