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 :
Dynamics 365 Community / Blogs / Hosk's Dynamic CRM Blog / CRM 4 – Plugin registration...

CRM 4 – Plugin registration problems – Could not load file or assembly

Hosk Profile Picture Hosk

I tried registering a plugin in CRM 4 and it was hard work.

Firstly I had to build the Plugin Registration Tool, WHY???

I then initially tried to register my plugin, only to find I had not implemented the plugin interface.  I tried to compile the simple walkthrough in the SDK which had compile errors in!!

I signed my plugin (although it was pfx and snk)

but then when I tried to registered the plugin I got this error

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Crm.Sdk, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified.
at System.Reflection.Assembly._GetExportedTypes()
at System.Reflection.Assembly.GetExportedTypes()
at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path) in C:\<path>\PluginRegistrationV2\PluginRegistration\AssemblyReader.cs:line 59
at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)
at PluginRegistrationTool.RegistrationHelper.RetrievePluginsFromAssembly(String pathToAssembly) in C:\<path>\PluginRegistrationV2\PluginRegistration\RegistrationHelper.cs:line 49
at PluginRegistrationTool.PluginRegistrationForm.btnLoadAssembly_Click(Object sender, EventArgs e) in C:\<path>\PluginRegistrationV2\PluginRegistration\PluginRegistrationForm.cs:line 127

This forum post was very helpful the problem was the microsoft.crm.sdk.dll has to be in the same directory as the Plugin Registration tool.

I put this in the same folder but I was still having problems.

The reason for this was because I had copied in the 32 bit microsoft.crm.sdk.dll and instead I swapped this with the 64 bit microsoft.crm.sdk.dll and then it worked.

I don’t know why Microsoft make this so difficult because there is nothing worse than having to go through these problems when you are just setting up a system.

There must be some reason they don’t add the plugin registration tool as an Exe but I have never figured it out.


Filed under: CRM 4, plugin registration, plugins

This was originally posted here.

Comments

*This post is locked for comments