Project attempting to access version of DLL I have never used
<p>My project is attempting to reference a version of a DLL that I have never used. When attempting to access my database I get the error:</p>

<blockquote>
  <p>A first chance exception of type 'System.IO.FileLoadException' occurred in Windows Service Manager.exe</p>
  
  <p>Additional information: Could not load file or assembly 'System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. </p>
</blockquote>

<p>Now that makes sense, it shouldn't be able to find it, as it has never existed.</p>

<p>The only version referenced in my project is <code>4.0.8902.1</code>, and in the project's <code>app.config</code> the reference is:</p>

<blockquote>
<pre><code>  &lt;dependentAssembly&gt;
    &lt;assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" /&gt;
    &lt;bindingRedirect oldVersion="4.0.0.0-4.0.0.1" newVersion="4.0.0.1" /&gt;
  &lt;/dependentAssembly&gt;
</code></pre>
</blockquote>

<p>This is the only version referenced anywhere in the project.</p>

<p>I would of course like to know how to fix it, but does anyone know how it is possible for a project to start arbitrarily referencing DLL versions that have never existed, and that are not referenced anywhere in the project? The only thing that changed from when it was working correctly and now is that I stopped working on this project for a few hours, and re-opened it.</p>

<p>Edit:</p>

<p>During build I see:</p>

<blockquote>
  <p>Consider app.config remapping of assembly "System.Data.SqlServerCe, Culture=neutral, PublicKeyToken=89845dcd8080cc91" from Version "3.5.1.0" [] to Version "4.0.0.1" [C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Private\System.Data.SqlServerCe.dll] to solve conflict and get rid of warning.</p>
</blockquote>

<p>Which isn't necessarily helpful as there is no <code>app.config</code> that references 3.5.1.0. I have checked every app.config in the solution, and even simply searching for the text <code>3.5.1.0</code> and it simply does not exist... I do not know how to fix this.</p>

<p>The next thing I can think of is to search my entire hard drive for the string '3.5.1.0'... So I will try that.</p>