Edward Tanguay
Edward Tanguay

Reputation: 193472

Best practice for SQLite with WPF and ASP.NET MVC?

What is the correct way to work with SQLite in WPF and ASP.NET MVC?

Upvotes: 3

Views: 2220

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039598

You can add the test.sqlite file to your WPF project and in the properties window specify the "Copy To Output Directory" : "Copy always". This way every time you compile your project, the file will be automatically copied to the output directory.

Concerning your UnauthorizedAccessException have you tried granting read and write permissions on the App_Data folder for the ASP.Net Service account? To find out the account used to run the application pool you can write a simple test.aspx page:

<%@ Page Language="C#" %>
<script runat="server">
  protected override void OnLoad(EventArgs e)
  {
      Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
      base.OnLoad(e);
  }
</script>

Upvotes: 4

Related Questions