title: Could not load file or assembly 'Microsoft.Data.Service' or one of its dependencies. The system cannot find the file specified
body: <p>I just switched my computer and one of my project is no longer running properly and throws the error in title. <em>(you may also find complete error message below)</em>  It is clearly looking for wrong place but at this point I'm not sure what to change.  Please advise.</p>
  
  <blockquote>
    <p><strong>Some facts to keep in mind</strong></p>
    
    <ul>
    <li>I did not change no line of code in source</li>
    <li>It is working fine on new production server which gets deployed by <em>VSTS</em></li>
    <li>I'm using <em>IISExpress</em> to run it</li>
    <li>I'm using <em>Visual Studio 2015 v14.0.25431.01 Update 3</em></li>
    <li>One of the main difference from my last computer, this one has <em>Visual Studio 2017 RC</em> in it. <em>(I don't think that's causing anything but who knows)</em></li>
    </ul>
  </blockquote>
  
  <h2>Programs and Features</h2>
  
  <p>Following application exist</p>
  
  <ul>
  <li>WCF Data Services 5.6.3 Tools</li>
  </ul>
  
  <h2><em>Bin</em> directory</h2>
  
  <p>Following files exist</p>
  
  <ul>
  <li>Microsoft.Data.Edm.dll</li>
  <li>Microsoft.Data.OData.dll</li>
  <li>Microsoft.Data.Services.Client.dll</li>
  <li>Microsoft.Data.Services.dll</li>
  </ul>
  
  <h2>DataService.svc <em>(complete)</em></h2>
  
  <pre><code>&lt;%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Service="Company.Project.Services.DataService" %&gt;
  </code></pre>
  
  <h2>Web.Config <em>(partial)</em></h2>
  
  <pre><code>&lt;runtime&gt;
    &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
      &lt;dependentAssembly&gt;
        &lt;assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /&gt;
        &lt;bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" /&gt;
      &lt;/dependentAssembly&gt;
      &lt;dependentAssembly&gt;
        &lt;assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
        &lt;bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" /&gt;
      &lt;/dependentAssembly&gt;
      &lt;dependentAssembly&gt;
        &lt;assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
        &lt;bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" /&gt;
      &lt;/dependentAssembly&gt;
      &lt;dependentAssembly&gt;
        &lt;assemblyIdentity name="Microsoft.Data.Services" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
        &lt;bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" /&gt;
      &lt;/dependentAssembly&gt;
    &lt;/assemblyBinding&gt;
  &lt;/runtime&gt;
  </code></pre>
  
  <h2>Error Page</h2>
  
  <p><strong>Server Error in '/' Application.</strong></p>
  
  <p><em>Could not load file or assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</em></p>
  
  <p><strong>Description:</strong> An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  
  <p><strong>Exception Details:</strong> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</p>
  
  <p><strong>Source Error:</strong></p>
  
  <pre><code>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  </code></pre>
  
  <p><strong>Assembly Load Trace:</strong> The following information can be helpful to determine why the assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.</p>
  
  <pre><code>=== Pre-bind state information ===
  LOG: DisplayName = Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   (Fully-specified)
  LOG: Appbase = file:///C:/Source/github/company/repository/project/HubServices/
  LOG: Initial PrivatePath = C:\Source\github\company\repository\project\HubServices\bin
  Calling assembly : (Unknown).
  ===
  LOG: This bind starts in default load context.
  LOG: Using application configuration file: C:\Source\github\company\repository\project\HubServices\web.config
  LOG: Using host configuration file: C:\Users\user\Documents\IISExpress\config\aspnet.config
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
  LOG: Redirect found in application configuration file: 5.0.0.0 redirected to 5.7.0.0.
  LOG: Post-policy reference: Microsoft.Data.Services, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  LOG: The same bind was seen before, and was failed with hr = 0x80070002.
  </code></pre>
  
  <p><strong>Stack Trace:</strong></p>
  
  <pre><code>[FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
  
  [FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
     System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
     System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
     System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark&amp; stackMark) +40
     System.Type.GetType(String typeName, Boolean throwOnError) +34
     System.ServiceModel.Activation.ServiceParser.GetType(String typeName) +55
     System.ServiceModel.Activation.ServiceParser.GetCompiledType(Assembly compiledAssembly) +76
     System.ServiceModel.Activation.ServiceParser.CreateParseString(Assembly compiledAssembly) +38
     System.ServiceModel.Activation.ServiceBuildProvider.GetCustomString(CompilerResults results) +33
     System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +182
     System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +16
     System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +10098689
     System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +294
     System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
     System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) +82
     System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +31
     System.ServiceModel.HostingManager.GetCompiledCustomString(String normalizedVirtualPath) +163
     System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +201
     System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
     System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +641
  
  [ServiceActivationException: The service '/DataService.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not load file or assembly 'Microsoft.Data.Services, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
     System.Runtime.AsyncResult.End(IAsyncResult result) +481507
     System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +174
     System.ServiceModel.Activation.ServiceHttpHandler.EndProcessRequest(IAsyncResult result) +11
     System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129
  </code></pre>