title: Microsoft.Data.SQLite: Library e_sqlite3 not found
body: <p><strong>Problem:</strong>
  I'm trying to develop an ASP.NET MVC <strong>(.Net Framework 4.7.2)</strong> web app in which I want to use <code>Microsoft.Data.Sqlite</code> version <strong>(5.0.2)</strong>, but when I run it my web app crashes (both in debug IIS Express, and in app.publish on local IIS on Windows 10) at following code line:</p>
  <pre><code>SqliteConnection dbConn = new SqliteConnection(&quot;Data Source=test.db&quot;);
  </code></pre>
  <p>The exception thrown is as under:</p>
  <pre><code>System.TypeInitializationException
    HResult=0x80131534
    Message=The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception.
    Source=Microsoft.Data.Sqlite
    StackTrace:
     at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
     at sqliteTest.Controllers.ValuesController.Get() in C:\Users\FaqeerHussain\source\repos\sqliteTest\sqliteTest\Controllers\ValuesController.cs:line 16
     at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.&lt;&gt;c__DisplayClass6_2.&lt;GetExecutor&gt;b__2(Object instance, Object[] methodParameters)
     at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
     at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
  
    This exception was originally thrown at this call stack:
      [External Code]
  
  Inner Exception 1:
  TargetInvocationException: Exception has been thrown by the target of an invocation.
  
  Inner Exception 2:
  Exception: Library e_sqlite3 not found
  </code></pre>
  <p><strong>What I've tried so far:</strong>
  Following <code>Inner Exception: Library e_sqlite3 not found</code> tried looking around the <strong>'bin'</strong> folder, and found that <strong>e_sqlite3.dll</strong> is already there in <code>bin\runtimes\win-x64\native</code> and also in <code>bin\runtimes\win-x86\native</code> folders, both contain e_sqlite3.dll.
  Tried copying manually the above-mentioned x86/x64 e_sqlite3.dll to root <code>bin</code> folder but the error still remains.</p>
  <p>What should I do to get <code>Microsoft.Data.Sqlite</code> working in my ASP.NET MVC (.NET Framework 4.7.2) web app?</p>