I implemented one custom workflow in in Visual Studio 2010 using CRM 2011 Developer Toolkit. It was working fine with system generated namespace. But, when I changed the namespace of my project, its throwing an error "Error registering plugins and/or workflows. Plug-in assembly does not contain the required types or assembly content cannot be updated." while deploying it. And I have changed the namespace in .crmregister file, project properties and in source code. Then whats the problem here.?
If you are deployong your custome workflows via CRM development toolkint and package and then after that if you have changed any class name or namespace, you must change RegisterFile.crmregister file manually as Visual Studio does not do it for you. So if you change your class name from A to B and your namespace from N to M then 'TypeName' from the below xml in RegisterFile.crmregister file must be as following:
<?xml version="1.0" encoding="utf-8"?>
<Register xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/crm/2011/tools/pluginregistration">
<Solutions>
<Solution Assembly="PackageECRProcesses.CleanRegistration.dll" Id="ab72673b-c0a8-e111-af82-080027dd322f" IsolationMode="None" SourceType="Database">
<WorkflowTypes>
<WorkflowType FriendlyName="any" Name="any" Description="any." WorkflowActivityGroupName="account" Id="f0e3f436-c1a8-e111-af82-080027dd322f" TypeName="M.B" />
</WorkflowTypes>
</Solution>
</Solutions>
<XamlWorkflows />
</Register>
In our case we used ILMerge
and accidentally we merged Microsoft.Xrm.Sdk.dll
into our plugin, removing this dll (copy local = false
) fixed the issue.
This merged dll was not working anyway as it throw security exception
Inheritance security rules violated while overriding member: 'Microsoft.IdentityModel.Claims.ClaimsIdentity.System.Runtime.Serialization.ISerializeable.GetObjectData
this GetObjectData was present in Microsoft.Xrm.Sdk.dll hence security exception from SandBox deployment.
I just encountered the exact same issue while toying with the CRM Toolkit.
This is how I solved the issue:
I didn't have to manually edit anything.
Try to change assembly version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With