title: System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite
body: <p>(This is a duplicated question which has been asked in stackoverflow.com. I have read the answers. I've tried the solutions, but that didn't solve my problem. I'm going to explain what my problem is and what have I done).</p>
  
  <p><strong>This is my problem:</strong></p>
  
  <p>My application used System.Data.SQLite.DLL. I referenced it and run normally in my computer, but it failed to run on another computer. This is the error message:</p>
  
  <blockquote>
    <p>System.IO.FileLoadException: Could not load file or assembly 
        'System.Data.SQLite, Version=1.0.88.0, Culture=neutral, 
        PublicKeyToken=db937bc2d44ff139' or one of its  dependencies. 
        The application has failed to start because its side-by-side<br>
        configuration is incorrect. Please see the application event 
        log or use the  command-line sxstrace.exe tool for more detail.<br>
        (Exception from HRESULT: 0x800736B1) File name: 'System.Data.SQLite, 
        Version=1.0.88.0, Culture=neutral,  PublicKeyToken=db937bc2d44ff139'
        ---> System.Runtime.InteropServices.COMException  (0x800736B1): 
        The application has failed to start because its side-by-side<br>
        configuration is incorrect. Please see the application event log or 
        use the  command-line sxstrace.exe tool for more detail.<br>
        (Exception from HRESULT: 0x800736B1)
               at SimPB.config.PrepareDatabase()
               at SimPB.config.InitializeProgram()
               at SimPB.Program.Main()</p>
  </blockquote>
  
  <p>My computer is running Windows 7 32 bit, Visual Studio 2010.</p>
  
  <p>Another computer is running Windows 7 32 bit too, without Visual Studio installed.</p>
  
  <p><strong>What I have tried:</strong></p>
  
  <p><strong>Attempt 1:</strong> Make sure the application is build with <strong>Release + x86</strong> and the application is build with the target framework: <strong>.NET Framework 2.0</strong>. Done.</p>
  
  <p><strong>Attempt 2:</strong> Make sure the application referenced with the correct build of System.Data.SQLite, which is x86 + .Net Framework 2.0 (sqlite-netFx20-binary-Win32-2005-1.0.88.0). Done</p>
  
  <p><strong>Attempt 3:</strong> Try these codes at App.config:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v2.0.50727"/&gt;
    &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>and this</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v2.0.50727"/&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;
    &lt;/startup&gt;
    &lt;runtime&gt;
      &lt;NetFx40_LegacySecurityPolicy enabled="true"/&gt;
    &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>and this</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt;
      &lt;supportedRuntime version="v2.0.50727"/&gt;
    &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Done.</p>
  
  <p><strong>Attempt 4:</strong> Try turn off User Account Control on the another computer. Done.</p>
  
  <p><strong>Attempt 5:</strong> Try install Visual C++ Runtime on the another computer (I install Visual Microsoft Visual C++ Runtime 2010 Redistributable Package (x86), also tried 2005 verson.). Done.</p>
  
  <p><strong>Attempt 6:</strong> Try reinstall .NET Framework 2.0 SP2. Receive error:</p>
  
  <blockquote>
    <p>You must use "Turn Windows Features On or Off" in the Control Panel to 
        install or configure Microsoft .NET Framework 2.0 SP2.</p>
  </blockquote>
  
  <p>Updated: (After reading answers and comments)<br />
  <strong>Attempt 7:</strong> Make sure System.Data.SQLite.DLL is located at the output bin folder. Done</p>
  
  <p><strong>Attempt 8:</strong> Double confirm that the another computer is running 32bit Windows 7. Done</p>
  
  <p><strong>Attempt 9:</strong> Change the HintPath declaration in .csproj file:<br />
  Change this:</p>
  
  <pre><code>&lt;Reference Include="System.Data.SQLite, Version=1.0.88.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"&gt;
    &lt;HintPath&gt;E:\Developer Soft\SQLite\sqlite-netFx20-binary-bundle-Win32-2005-1.0.88.0\System.Data.SQLite.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>&lt;Reference Include="System.Data.SQLite, Version=1.0.88.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"&gt;
    &lt;HintPath&gt;..\System.Data.SQLite.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  </code></pre>
  
  <p><em>Done for Attempt 9.</em></p>
  
  <p>After the above attempts, the result is still the same. The application can run from my computer normally and failed to run on the another computer.</p>
  
  <p>This is an open source freeware, <strong>Simple Phone Book</strong>. I have committed and uploaded the latest source code to it's source control server at:<br /> <a href="http://simpb.codeplex.com/SourceControl/list/changesets" rel="noreferrer">http://simpb.codeplex.com/SourceControl/list/changesets</a> (Changeset Number: fd847ac6c406)</p>