title: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Client
body: <p>I am stuck on this exception already for two days.
  I am using MS CRM 2011, and got this exception when I try to register CRM custom worklow activity assembly 
        1. through pluginregistrator tool,
        2.  or when I deploy the plugin though package project in Visual Studio and after it run the the workflow, and it stops with waiting  status, in the details page giving this expcetion. Here is the detailed exception:</p>
  
  <blockquote>
    <p>Workflow paused due to error: Unhandled Exception: 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.
       at ArmenianSoftware.Crm.Spayka.ArmsoftIntegration.Workflows.CreateWorksByPlan.Execute(CodeActivityContext executionContext)
       at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
       at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)</p>
  </blockquote>
  
  <p>I am registering assembly on the file system, I have loaded all needed assemblies in the folder %system root%\C$\Program Files\Microsoft Dynamics CRM\Server\bin\assembly. This workflow worked some time, but after I don't know what, next time I deployed the assembly, I got this exception when executing the workflow. This is already third time I am coming across this problem, and spoiling several hours trying to do different things (IIS reset, Async Service restarts, reloading all the assemblies again and redeploying), and after several hours, in a mysterious way, the workflow starts to work. After this works some time, and after some redeployment crashes again. And I can't determine after exactly what steps I solve the problem, and so I spend always several hours on finding out the exception source but to no purpose.
   I have looked through some threads in the web but none of them was my case (here are they <a href="http://social.microsoft.com/Forums/en-US/crmdeployment/thread/f1cea2b4-0b19-45bc-afe4-5ef7e7b609dd" rel="nofollow">thread1</a> , <a href="http://blogs.msdn.com/b/madenwal/archive/2011/04/21/crm-service-exception-could-not-load-file-or-assembly-microsoft-identitymodel-version-3-5-0-0-culture-neutral-publickeytoken-31bf3856ad364e35-or-one-of-its-dependencies.aspx" rel="nofollow">thread2</a> , <a href="http://stefanscheller.wordpress.com/2011/02/23/could-not-load-file-or-assembly-microsoft-xrm-client-at-plugin-registration/" rel="nofollow">thread3</a>)
  Have anybody come across this problem? What is the reason of this exception??
  Thanks in advance!</p>