Issue:
When trying to register a custom workflow on disk I would get the below error message.
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.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>2015-02-12T09:25:34.9332313Z</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>2015-02-12T09:25:34.9332313Z</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)
Resolution:
What finally worked for was to give everyone permission to the the dll.