web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Inheritance problems when using PluginRegistration CRM2011?

(0) ShareShare
ReportReport
Posted on by

 Hi,

 I'm having problem registering my plugin (.NET4, CRM2011 plugin) I'm getting the following error.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'COMPANYNAME.XrmFrameWork.Base, Version=1.0.0.0, Culture=neutral, PublicKeyToken=45c1c3ad35f52145' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)
   at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)
   at PluginRegistrationTool.RegistrationHelper.RetrievePluginsFromAssembly(String pathToAssembly)
   at PluginRegistrationTool.PluginRegistrationForm.btnLoadAssembly_Click(Object sender, EventArgs e)

 when trying to register the plugin, I gotten so far in my debugging to see that it has something to do with inheritance.

 My code is as follows :
 We have on dll (COMPANYNAME.XrmFrameWork.Base) containing a BasePluginAction (extends IPlugin) which implements the Exectute(IServiceProvider)-method. It does some prechecks and postchecks and also some logging on errors.

 In my solution I have 3 dlls, (Base,Business, Plugins). In the Base I have a solution specific class PluginBaseSolution where I add initialization of the loggers etc in the way this solution does it.

 All Plugins in the Plugins.dll inherits from this, idea here is that if there will be customer specific plugins made they will be their own .dll but will inherit from the same PluginBaseSolution as the "base" does.

 Here we come back to my problem, if loading the solution specific Base.dll I can see the listed baseclass as a plugin. But when loading the Plugin.dll it complains about the COMPANYNAME.XrmFrameWork.Base.dll.

 All dlls have been added to the GAC and all dlls also exists the same directory as the Plugin.dll.

 If I move the Baseclass to the Plugin.dll I can load the assembly. I still cannot import it I get the error :
"Plug-in assembly does not contain the required types or assembly content cannot be updated."

 But has anyone done anything similar in crm2011 and gotten it to work? In CRM4 this worked OK.

 

*This post is locked for comments

I have the same question (0)
  • Kjell Lönnqvist Profile Picture
    on at

    Hi I got around the problem with required types by adding the dlls to the CRMWeb\bin-directory. It seems like it is not using GAC as I thought it would

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans