dotnet / docs-maui

This repository contains documentation for .NET Multi-platform App UI (MAUI).
https://docs.microsoft.com/dotnet/maui
Creative Commons Attribution 4.0 International
231 stars 202 forks source link

Migrating from Xamarin.Essentials SecureStorage to .NET MAUI SecureStorage #1640

Closed davidortinau closed 1 year ago

davidortinau commented 1 year ago

Users updating their apps from Xamarin.Forms to .NET MAUI will hit an issue if they stored data in secure storage using Xamarin.Essentials SecureStorage. On iOS, the preferences shared name has changed. On Android, a different encryption approach is used and the preferences shared name has changed.

In Xamarin.Essentials the preferences shared name is {your-app-package-id}.xamarinessentials. In .NET MAUI the preferences shared name is {your-app-package-id}.microsoft.maui.essentials.preferences.

Write a doc that explains how to migrate data from Xamarin.Essentials SecureStorage to .NET MAUI SecureStorage.


Associated WorkItem - 155404

davidbritch commented 1 year ago

After looking at this I've realised that it's really three separate tasks:

  1. Migrate from Xamarin.Forms App.Properties to .NET MAUI Preferences. This will trip users up because (1) the Properties dict threw a NotSupportedException in .NET 6/7 (rather than being obsolete but working), and has been completely removed in .NET 8.
  2. Migrate Xamarin.Essentials VersionTracking to .NET MAUI VersionTracking (different shared name for the preferences).
  3. Migrate from Xamarin.Essentials SecureStorage to .NET MAUI SecureStorage (different filenames used, and completely different encryption approach used on Android).

I'm going to rename this issue to make it about (3), and will open separate issues for (1) + (2).

davidbritch commented 1 year ago

https://github.com/dotnet/docs-maui/issues/1690 and https://github.com/dotnet/docs-maui/issues/1691