title: SQLite 1.0.65 Assembly binding error
body: <p>I am developing an outlook add in, which uses SQLite. Outlook is throwing an exception Unable to bind assembly. I enabled the fusion log and found out that "Managed Assembly" is loading fine as it is visible from  the following log </p>
  
  <pre><code>    *** Assembly Binder Log Entry  (16/08/2012 @ 14:13:37) ***
  
  The operation was successful.
  Bind result: hr = 0x0. The operation completed successfully.
  
  Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
  Running under executable  C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE
  --- A detailed error log follows. 
  
  === Pre-bind state information ===
   LOG: DisplayName = System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
       (Fully-specified)
      LOG: Appbase = file:///C:/Program Files/TargetIntegration/CiviSync/
      LOG: Initial PrivatePath = NULL
      LOG: Dynamic Base = NULL
      LOG: Cache Base = NULL
      LOG: AppName = OUTLOOK.EXE
      Calling assembly : ServiceStack.OrmLite.SqliteNET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
      ===
      LOG: This bind starts in default load context.
      LOG: Using application configuration file: C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE.Config
      LOG: Using host configuration file: 
      LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
      LOG: Post-policy reference: System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
      LOG: GAC Lookup was unsuccessful.
      LOG: Attempting download of new URL file:///C:/Program Files/TargetIntegration/CiviSync/System.Data.SQLite.DLL.
      LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\&lt;CompName&gt;\CiviSync\System.Data.SQLite.dll
      LOG: Entering download cache setup phase.
      LOG: Assembly Name is: System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
      WRN: A duplicate assembly was found while copying the assembly item to the cache.
      LOG: Binding succeeds. Returns assembly from C:\Users\&lt;UserName&gt;\AppData\Local\assembly\dl3\9N164N9X.7OK\DRB00MX7.CBX\2f49c891\005cc530_ea6ccd01\System.Data.SQLite.dll.
      LOG: Assembly is loaded in default load context.
  </code></pre>
  
  <p>But it is throwing an exception while loading the native assembly, as per the following exception. </p>
  
  <pre><code>*** Assembly Binder Log Entry  (16/08/2012 @ 14:13:37) ***
  
  The operation failed.
  Bind result: hr = 0x80070002. The system cannot find the file specified.
  
  Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
  Running under executable  C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE
  --- A detailed error log follows. 
  
  === Pre-bind state information ===
  LOG: DisplayName = System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139
   (Fully-specified)
  LOG: Appbase = file:///C:/Program Files/TargetIntegration/CiviSync/
  LOG: Initial PrivatePath = NULL
  LOG: Dynamic Base = NULL
  LOG: Cache Base = NULL
  LOG: AppName = OUTLOOK.EXE
  Calling assembly : ServiceStack.OrmLite.SqliteNET, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
  ===
  LOG: Start binding of native image System.Data.SQLite, Version=1.0.65.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139.
  WRN: No matching native image found.
  LOG: IL assembly loaded from C:\Users\&lt;username&gt;\AppData\Local\assembly\dl3\9N164N9X.7OK\DRB00MX7.CBX\2f49c891\005cc530_ea6ccd01\System.Data.SQLite.dll.
  </code></pre>
  
  <p>I have no idea, why is this happening. This is happening on one of the client machine after the release build. On my machine even after the release build it is working fine. </p>
  
  <p>Not even that, even after the exception, add in works fine. </p>
  
  <p>Regards
  Mohit Thakral </p>