0

I created a new folder in my MAUI project and named it Database and would like this folder to be the destination of my.db3 file instead of FileSystem.AppDataDirectory, for testing purposes. So far I could not find a way to point to the correct path of this local project folder. I tried to copy the full path in my Solution Explorer, but passing this path did not work, maybe it needs to be formatted in a different way? I'm not sure.

C:\Users\UserA\source\repos\SolutionName\ProjectName\Database\

I'm assuming the following is a typical thought process of a Maui developer:

  1. Create a local database file in a Maui project folder
  2. When database is ready for deployment, move it manually to the Resources\Raw folder
  3. Upon deployment, copy file to AppDataDirectory

Assuming this is an acceptable thought process, if not please correct me, how do I point to the correct path of a project folder?

4
  • files included in the project bundle are read-only at runtime. If you want to include an existing DB in your project, you should put it in Resources/Raw and copy it to an app folder at startup
    – Jason
    Commented Sep 3, 2024 at 22:26
  • @Jason, does the bundle concept applies to all project folders or just the Resources folder? Because if it is the later, then this does not apply to the Database folder I created.
    – usefulBee
    Commented Sep 3, 2024 at 22:44
  • 1
    AFAIK anything included in the app bundle at build time is read-only. This is definitely true on iOS and Android, not as positive about Windows
    – Jason
    Commented Sep 3, 2024 at 22:48
  • 1
    Jason is right anything added into the project is readonly
    – FreakyAli
    Commented Sep 4, 2024 at 3:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.