iOS maui can create file but not open

Phunction 256 Reputation points
2024-09-11T23:18:18.2233333+00:00

Has anyone run into this? In my app, I create a sqlite database and then open it later.

This works fine on windows and android.

However, on iOS, I can create the database but I am unable to then open it later, when I try to open the connection, I get and an error 14 unable to open database.

The path I am using is:

Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

I have used this with my xamarin.ios app before and sqlite without any problems.

Is there some kind of permission issue that I am missing with the maui app? Why am I able to create the file but not read it?

If I copy the file I created off of the iOS device, I can then normally use and open that database on the other platforms, so the file being create is fine so not sure what is going on.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,449 questions
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 30,831 Reputation points Microsoft Vendor
    2024-09-16T06:22:49.0266667+00:00

    Hello,

    As you said, you solved the after recreating the project. Thanks for your sharing.

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.