I'm trying to create the database file to initialize it but I'm getting "Access Denied" error during execution. I think is something related with permissions but I'm not able to find any information that could fix it, since every guide I check does it the same way. This is an UWP application using C# and SQLite library. Thanks in advance for the help.
In the past I've tried to also create json file with other methods but I've never been able to create a file from a UWP application
Code that raises an error:
private const string DBName = "data.sqlite";
if (!File.Exists(Path.GetFullPath(DBName)))
{
SQLiteConnection.CreateFile(DBName);
RecentlyCreated = true;
}
Error message:
System.UnauthorizedAccessException: 'Access to the path 'C:\Users\myuser\source\repos\Pass\Pass\bin\x64\Debug\AppX\dataAccount.sqlite' is denied.'