question

StefanoM-9408 avatar image
0 Votes"
StefanoM-9408 asked ColeXia-MSFT answered

Files within the application remain even after uninstallation

I have created some files within my Xamarin Forms application.

 string Emoji = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Emoji.json");

I have created some files within my Xamarin Forms application. but although I uninstall the application from the phone and debug again with VisualStudio, the files inside remain, with everything that was previously saved. How could I solve?


dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ColeXia-MSFT avatar image
0 Votes"
ColeXia-MSFT answered

Hello,

Welcome to Microsoft Q&A!

If the file is stored in Environment.SpecialFolder.LocalApplicationData , the exact file path is /data/user/0/com.companyname/files/.local/share , this belongs to internal storage , it should be deleted when the app is uninstalled .

I test with LocalApplicationData , but I didn't find the path /.local/share , it seems to be hidden .

80909-capture.png


I suggest you use Environment.SpecialFolder.MyDocuments instead , the file is deleted as expected when app uninstalled in my test .



If the response is helpful, please click "Accept Answer" and upvote it.
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.



capture.png (4.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.