Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Persistence Issue with MAUI .NET 8 #9627

Open
vsfeedback opened this issue Dec 17, 2024 · 1 comment
Open

Data Persistence Issue with MAUI .NET 8 #9627

vsfeedback opened this issue Dec 17, 2024 · 1 comment
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
I am encountering an issue while working on a .NET MAUI project using Visual Studio 2022 v.17.12.3 with .NET 8. Specifically, the problem involves the loss of application data when deploying a new build in both Debug and Release modes.

Here are the steps to reproduce the issue:

  1. Develop a .NET MAUI application that utilizes Preferences or SecureStorage to store persistent data.
  2. Compile and deploy the app to a physical or virtual device.
  3. Use the app to save some data via Preferences or SecureStorage.
  4. Perform a new build and deploy the updated version of the app to the same device without uninstalling the previous version.
  5. Observe that all previously saved data is lost after the new deployment.

Important Notes:

  • If the app is closed and reopened without deploying a new build, the data persists correctly.
  • The "Preserve Application Data Cache on device Between Deploys" option is enabled in the Visual Studio settings.
  • This issue occurs consistently in both Debug and Release mode.
  • The problem is reproducible on both an Android emulator (Pixel 7 with API 34) and a physical device running Android 10.

I have reviewed similar issues reported in the Developer Community but could not find a working solution for my case:

Expected Behavior: Data stored using Preferences or SecureStorage should persist across deployments when the "Preserve Application Data Cache on device Between Deploys" option is enabled.

Actual Behavior:
All saved data is lost after deploying a new build to the device in Debug mode.

Environment Details:

  • Visual Studio Version: 2022 v.17.12.3
  • Project Type: .NET MAUI
  • Target Framework: .NET 8
  • Deployment Platform: Android
  • Emulator: Pixel 7 (Android API 34)
  • Physical Device: Android 10

Please provide guidance or a workaround to resolve this issue. Thank you!


Original Comments

Feedback Bot on 12/12/2024, 05:48 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Dec 17, 2024
@jpobst
Copy link
Contributor

jpobst commented Dec 17, 2024

This seems to be related to #8472.

@jpobst jpobst added Area: App+Library Build Issues when building Library projects or Application projects. and removed needs-triage Issues that need to be assigned. labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests

4 participants