Answered by:
Crm2011 ur 13, workflow registration error

Question
-
I have a custom workflow implemented in c#. A tutorial for doing this can be found at http://msdn.microsoft.com/en-us/library/gg328515.aspx.
This workflow works fine with crm2011 ur11. Recently, I upgraded our dev box to ur 13 and found that I can no long register this workflow.
To reproduce this:
1. Unregister the workflow using Plugin Registration Tool
2. Register a new plugin
3. Choose the dll file for the workflow, choose isolation mode NONE, and Location of Assembly to Disk.
4. The Plugin Assembly registered correctly, but the activity registration failed.
Error message I got was:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Assembly can not be loaded.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ErrorCode>-2147200995</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Assembly can not be loaded.</Message>
<Timestamp>2013-06-12T23:39:28.6337812Z</Timestamp>
<InnerFault>
<ErrorCode>-2147200995</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Assembly can not be loaded.</Message>
<Timestamp>2013-06-12T23:39:28.6337812Z</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.Create(Entity entity)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.CreateCore(Entity entity)If I choose the location in Step 3 to Database, then I could register, but I am not sure if the workflow will work.
I have the dll file placed under Server/bin/assembly as suggested at http://stackoverflow.com/questions/6255444/dynamics-crm-2011-cannot-register-plugin-to-disk/6268287#6268287
Also, I have given full control to the NetService user.
- Edited by Wei Ma - Vancouver Wednesday, June 12, 2013 11:51 PM
Wednesday, June 12, 2013 11:51 PM
Answers
-
Hi Everyone,
This is sort of an old topic but I was experiencing the exact same issue while registering a Custom Workflow to CRM 2013.
The solution was to give everyone read/write access to the Plugin/Workflow dll. Try adding the 'Everyone' user to the dll's permissions and give it full access.
Found the solution here: http://www.datazx.cn/Forums/en-US/cc666840-702d-4f2c-9cea-5d3cda58e808/action?threadDisplayName=can-not-register-plugin-by-plugin-registration-suddenly
Cheers.
- Marked as answer by Payman BiukaghazadehEditor Friday, December 11, 2015 7:59 AM
Wednesday, March 26, 2014 1:32 PM
All replies
-
Hello,
Did you tried registering the workflow in isolation mode to SANDBOX?.
Thursday, June 13, 2013 8:51 AM -
If your workflow assembly does not depend on any other assemblies, then it should work exactly the same regardless of whether it is registered on disk, or in the database.
So, I'd start by testing if it works with the assembly registered in the database.
Note that changes to assembly locations may not be picked up until after restarting the CRM Async service, and recycling the CRM application pool
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
Thursday, June 13, 2013 1:04 PMModerator -
@DavidJennaway
Thanks for your reply.
I tested the workflow that registered in database, and it worked. But I still prefer to register on disk as I have much more control such as writing my own log.
I also try to write a new workflow that contains no functionality at all. All I had was just a class implements CodeActivity and throws Exception in the Execute() method. I could not register this testworkflow either, to two dev installations. So, I am almost sure this is a bug in UR 13. I am surprised that no one else has encounter same problem. The closest issue I can find is at
http://community.dynamics.com/crm/f/117/t/99252.aspx#.Ubn-9G2mXzM
Thursday, June 13, 2013 5:19 PM -
Hi,
Encountered the same error with our solution. After, i tried to register a sample one liner activity to disk and got the same error, just like you.
I'm pretty sure its a bug in UR13.
Gabor
Edit: UR14 has the same problem...- Edited by mr_g_ Wednesday, July 31, 2013 10:11 AM
Wednesday, July 31, 2013 8:25 AM -
Hi Everyone,
This is sort of an old topic but I was experiencing the exact same issue while registering a Custom Workflow to CRM 2013.
The solution was to give everyone read/write access to the Plugin/Workflow dll. Try adding the 'Everyone' user to the dll's permissions and give it full access.
Found the solution here: http://www.datazx.cn/Forums/en-US/cc666840-702d-4f2c-9cea-5d3cda58e808/action?threadDisplayName=can-not-register-plugin-by-plugin-registration-suddenly
Cheers.
- Marked as answer by Payman BiukaghazadehEditor Friday, December 11, 2015 7:59 AM
Wednesday, March 26, 2014 1:32 PM