Answered by:
CRM 2011 - Cannot update plugin

Question
-
Hello,
We cannot update our existing plugin anymore (see message below).
Plugin build with the latest SDK dll's. CRM is 2011 with rollup1.
Is there a way to see more detailed error information?
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Plug-in assembly does not contain the required types or assembly content cannot be updated.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorCode>-2147204725</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Plug-in assembly does not contain the required types or assembly content cannot be updated.</Message>
<Timestamp>2011-04-12T09:02:15.6615167Z</Timestamp>
<InnerFault>
<ErrorCode>-2147204725</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Plug-in assembly does not contain the required types or assembly content cannot be updated.</Message>
<Timestamp>2011-04-12T09:02:15.6624932Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</OrganizationServiceFault>
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)
at PluginRegistrationTool.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type) in C:\My Data\MS CRM\CRM SDK 2011\sdk\tools\pluginregistration\RegistrationHelper.cs:line 263
at PluginRegistrationTool.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e) in C:\My Data\MS CRM\CRM SDK 2011\sdk\tools\pluginregistration\PluginRegistrationForm.cs:line 391thx,
Geert
Tuesday, April 12, 2011 9:07 AM
Answers
-
This error generally happens when your old plugin assembly contained some plugin types which were registered, but the new assembly content does not contain the corresponding types (for example you had a plugin called "MyPlugin" and then you changed the name of a class to "MyNewPlugin"). Another reason why you would get this message is if you have changed the assembly metadata (culture, version, public key token, etc). You are only allowed to change the build/revision number of the version, otherwise you cannot just "update the contents".
Verify that you haven't removed any of the existing plugins or changed the signature. Do you have any custom workflow activities in your plugin?
- Proposed as answer by Gonzalo Ruiz RModerator Tuesday, April 12, 2011 2:16 PM
- Marked as answer by Geert Mathijs Tuesday, May 10, 2011 6:25 AM
Tuesday, April 12, 2011 2:08 PMModerator
All replies
-
Do you have a default constructor in your plugin? Lack of this may sometimes throw such an errorTuesday, April 12, 2011 9:43 AM
-
Torstein,
For every class we have a default constructor (read this in a previous post already).
Tuesday, April 12, 2011 9:51 AM -
This error generally happens when your old plugin assembly contained some plugin types which were registered, but the new assembly content does not contain the corresponding types (for example you had a plugin called "MyPlugin" and then you changed the name of a class to "MyNewPlugin"). Another reason why you would get this message is if you have changed the assembly metadata (culture, version, public key token, etc). You are only allowed to change the build/revision number of the version, otherwise you cannot just "update the contents".
Verify that you haven't removed any of the existing plugins or changed the signature. Do you have any custom workflow activities in your plugin?
- Proposed as answer by Gonzalo Ruiz RModerator Tuesday, April 12, 2011 2:16 PM
- Marked as answer by Geert Mathijs Tuesday, May 10, 2011 6:25 AM
Tuesday, April 12, 2011 2:08 PMModerator -
I had this exact same error. I was trying to import a new version of an unmanaged solution on top of an old version of that solution. Reading this post gave me the idea that perhaps there was some conflict with a previous version of the plugin. I uninstalled the plugin on my target server, attempted the import solution again, and it worked.
Wednesday, April 20, 2011 5:08 PM -
I also had the same problem. the name of the signing key wasn't correct. I just changed the name of the key.Tuesday, August 16, 2011 8:11 AM
-
This is kind of an old post, but I thought I'd add my 2 cents since this pops up to the top when searching for this error.
I have seen this occur numerous times when using early bound types if a change has occured to the CRM schema. It can be resolved by regenerating the class file by re-running crmsvcutil and adding the newly generated file into your solution and re-building.
I blogged about it breifly as well here.
Tuesday, January 24, 2012 6:22 PM -
What if you need to change the signature as it was signed by the organization who originally developed the solution but they no longer maintain the solution? Their signature is private to them.Thursday, February 9, 2012 3:48 PM
-
Also realizing that the thread is old, but it still shows up on top of searches.
In our case the problem was that the WorkFlow "TypeName" had an invalid full type name. It had the wrong namespace.
This can easily happen if you are using the CRM Developers Toolkit Visual Studio 2010 addon. In our case, the RegisterFile.crmregister file was generated using the wrong namespace.
So, make sure you are using a TypeName that is correct to your actual namespace of your class.
Thanks, Robert
- Proposed as answer by Robert Shurtleff Tuesday, June 12, 2012 2:16 AM
Tuesday, June 12, 2012 2:16 AM -
Realizing that this thread is really really really really old (sorry, everyone else said it, I couldn't resist)
Another cause of this error is as follows:
1) You create a workflow activity with a class name of CreateTeam.
2) You publish your activity and create a workflow which uses this custom activity.
3) You decide that you want to rename the class to CreateAdminTeam and then try to publish again.You will get the "Plug-in assembly does not contain the required types or assembly content cannot be updated."
You will find that you are unable to delete your workflow or unregister your DLL.I just got this and the only way to get around it is to
1) rename your class back to what it was when you first published it,
2) re-publish it
3) Delete the workflow and unregister the DLL.
Then you can rename and republish your class.
Hope this helps someone
JonathanMonday, July 16, 2012 6:43 PM -
This psot should help:
http://gonzaloruizcrm.blogspot.ca/2012/08/crm-2011-plug-in-assembly-does-not.html
Gonzalo | gonzaloruizcrm.blogspot.com
Wednesday, August 29, 2012 5:29 PMModerator -
Hi there,
apart of above cases, check .snk file or .pfx file. Does it change in your second deployment.
in this case try to use old source code or else you need to re register the plug/workflow.Tuesday, November 20, 2012 5:58 AM