locked
Could not load file or assembly 'Microsoft.Xrm.Client' RRS feed

  • Question

  • Hi, We have on-premise Crm server, installed on small business windows 2008 server R2.  Crm works fine, but from time to time, it freeze. I don't know why :-( But I have found this error in CrmTraceLogs. It's looks, like I am missing assembly Microsoft.Xrm.Client. But I have checked all of my plugins and and custom wf activities and I am not using this assembly.

    Can somebody help?

    Thank you, Edo

    [2012-07-30 07:51:59.393] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread:   14 |Category: Platform.Sdk |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 6b8d8e59-bc6a-453d-8fca-ca5de0e33855 | ServiceModelTraceRedirector.TraceData
    at ServiceModelTraceRedirector.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
    at TraceSource.TraceData(TraceEventType eventType, Int32 id, Object data)
    at DiagnosticTrace.TraceEvent(TraceEventType type, Int32 code, String msdnTraceCode, String description, TraceRecord trace, Exception exception, Object source)
    at ExceptionUtility.TraceHandledException(Exception exception, TraceEventType eventType)
    at MessageRpc.ProcessError(Exception e)
    at MessageRpc.Process(Boolean isOperationContextSet)
    at ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
    at ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
    at ChannelHandler.AsyncMessagePump(IAsyncResult result)
    at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
    at AsyncResult.Complete(Boolean completedSynchronously)
    at ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)
    at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
    at AsyncResult.Complete(Boolean completedSynchronously)
    at AsyncQueueReader.Set(Item item)
    at InputQueue`1.Dispatch()
    at ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
    at IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
    at _IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
    ><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/sk-SK/library/System.ServiceModel.Diagnostics.TraceHandledException.aspx</TraceIdentifier><Description>Handling an exception.</Description><AppDomain>/LM/W3SVC/2/ROOT-1-129880728016341609</AppDomain><Exception><ExceptionType>System.IO.FileNotFoundException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</Message><StackTrace>   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
    >   at System.Reflection.RuntimeAssembly.GetExportedTypes()
    >   at Microsoft.Xrm.Sdk.KnownTypesProvider.get_KnownOrganizationRequestResponseTypes()
    >   at Microsoft.Xrm.Sdk.KnownTypesResolver.ResolveName(String typeName, String typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
    >   at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromDataContractResolver(XmlQualifiedName typeName, Type declaredType)
    >   at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromKnownTypes(String typeName, String typeNs, DataContract memberTypeContract, Type declaredType)
    >   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract&amp;amp; dataContract)
    >   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
    >   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
    >   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
    >   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
    >   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
    >   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><ExceptionString>System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
    >File name: 'Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
    >   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
    >   at System.Reflection.RuntimeAssembly.GetExportedTypes()
    >   at Microsoft.Xrm.Sdk.KnownTypesProvider.get_KnownOrganizationRequestResponseTypes()
    >   at Microsoft.Xrm.Sdk.KnownTypesResolver.ResolveName(String typeName, String typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
    >   at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromDataContractResolver(XmlQualifiedName typeName, Type declaredType)
    >   at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromKnownTypes(String typeName, String typeNs, DataContract memberTypeContract, Type declaredType)
    >   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract&amp;amp; dataContract)
    >   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
    >   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
    >   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
    >   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
    >   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
    >   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
    >   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp;amp; rpc)
    >   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    >
    >=== Pre-bind state information ===
    >LOG: User = PONTIS\CRM_APP_SRV
    >LOG: DisplayName = Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35
     (Fully-specified)
    >LOG: Appbase = file:///C:/Program Files/Microsoft Dynamics CRM/CRMWeb/
    >LOG: Initial PrivatePath = C:\Program Files\Microsoft Dynamics CRM\CRMWeb\bin
    >Calling assembly : (Unknown).
    >===
    >LOG: This bind starts in default load context.
    >LOG: Using application configuration file: C:\Program Files\Microsoft Dynamics CRM\CRMWeb\web.config
    >LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
    >LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
    >LOG: Post-policy reference: Microsoft.Xrm.Client, Version=5.0.9688.1154, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    >LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/82ce50f4/e77f4ed8/Microsoft.Xrm.Client.DLL.
    >LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/82ce50f4/e77f4ed8/Microsoft.Xrm.Client/Microsoft.Xrm.Client.DLL.
    >LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Dynamics CRM/CRMWeb/bin/Microsoft.Xrm.Client.DLL.
    >LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Dynamics CRM/CRMWeb/bin/Microsoft.Xrm.Client/Microsoft.Xrm.Client.DLL.
    >LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/82ce50f4/e77f4ed8/Microsoft.Xrm.Client.EXE.
    >LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/82ce50f4/e77f4ed8/Microsoft.Xrm.Client/Microsoft.Xrm.Client.EXE.
    >LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Dynamics CRM/CRMWeb/bin/Microsoft.Xrm.Client.EXE.
    >LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Dynamics CRM/CRMWeb/bin/Microsoft.Xrm.Client/Microsoft.Xrm.Client.EXE.
    ></ExceptionString></Exception></TraceRecord>


    Edo

    Monday, July 30, 2012 11:31 AM

All replies

  • You might be missing the DLL for some reason. Try to perform a "Repair" from Control Panel --> Programs & Features --> MSCRM 2011. That should resolve the problem.

    Gonzalo | gonzaloruizcrm.blogspot.com

    Monday, July 30, 2012 12:49 PM
    Moderator
  • We have tried update. It didn't help. Last weekend we re-install server, so I think the problem is somewhere else. But thank's for you help.

    Edo


    Monday, July 30, 2012 12:58 PM
  • Microsoft.Xrm.Client is needed to to create CrmOrganizationServiceContext.

    Check if you are using CrmOrganizationServiceContext in your code specially early bind classes using organization context.

    I hope this helps.


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com

    Monday, July 30, 2012 1:26 PM
  • Hi Eduard,

    There might be some

    using

    statements inside your code, To just workaround copy the Xrm.client DLL from SDK and put it inside the CRM installation bin folder.

    Regards,

    Hiren.

    Tuesday, July 31, 2012 9:42 AM
  • Assembly is there, but not the same version. In bin folder I have Microsoft.Xrm.Client, Version=5.0.9688.1155. But it looks like somothing is looking for diferent version (Microsoft.Xrm.Client, Version=5.0.9688.1154)

    Edo

    Tuesday, July 31, 2012 10:05 AM
  • Hi Edo/Hiren/Amreek

    Is this issue resolved?

    I am getting the issue on production server and not development server.

    Is this because of SDK versions changed?

    Can you please me how you resolved issue?

    ---Vikram.B

    Sunday, January 20, 2013 8:17 AM
  • If you have installed any rollups this file will change so what you need to do is update any of your mscrm references in the vs projects to reference the same sdk library dll versions. You can find this dll in sdk/bin folder. Check YOUR GAC AND SEE IF YOU CAN FIND dll version. If you find the file in GAC with your version then rename the latest version in the Crm Installation bin and check if it makes any difference. Also Copy microsoft.xrm.client.dll to the CRMWeb\bin and Server\bin folders.

    Hope this helps. Amar

    CRM Forum Guidance on how to Help Us Help You


    Sunday, January 20, 2013 4:41 PM
  • Hi,

    I have faced this issue before. Download latest SDK. Find the " Microsoft.Xrm.Client.dll" in SDK and place this DLL in GAC and CRM bin folder(within Assembly folder). 

    Chandan - http://mscrm-chandan.blogspot.in/ I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful !!!

    • Proposed as answer by D Suresh Kumar Tuesday, January 22, 2013 10:13 AM
    Monday, January 21, 2013 5:32 AM