App update for Windows Store from Xamarin to MAUI (msixbundle) deleted user data

Brian Conrad 111 Reputation points
2026-05-20T21:40:14.7333333+00:00

I've had my Windows app in the Windows Store since 2017, updated the bundle numerous times but the new bundle which is the migration from Xamarin to MAUI unexpectedly deleted my user's data. The msix in the bundle for x64 was tested and it installed without deleting the user data so this was unexpected.

I used VS 2026 and the Windows Kit for it because the VS 2022 Windows Kit was no longer available. Previously one could just select what MSIX files could be included in the bundle via checkmark, run the process and the bundle was created. This time I had to complete the process manually by these steps:

https://learn.microsoft.com/en-us/windows/msix/packaging-tool/bundle-msix-packages#step-2-bundle-the-packages

Note these instructions are from 2022!

Is there something I missed in the Package.appxmanifest to prevent the deletion of user files. I never had to do that before and always the policy was the Microsoft would NEVER delete user data?

Also I am disappointed like other developers have mentioned that the process has become harder than easier.

Windows development | Windows App SDK
0 comments No comments

4 answers

Sort by: Newest
  1. Brian Conrad 111 Reputation points
    2026-07-08T20:56:32.2466667+00:00

    To finally fix this problem using along the lines of previously mentioned at startup I check if the expected database file is in the LocalState folder. If it is not there check the LocalCache/Local folder. If there then copy it from the LocalCache/Local folder to the LocalState folder. If it is not in the cache folder nor the state folder then it is a new install and no database yet created. What may have caused confusion is the way these folders were accessed in Xamarin Form vs MAUI. For clarity:

    // MAUI LocalState folder
    var dbpath = Path.Combine(FileSystem.AppDataDirectory, <database file>);
    
    // cache file LocalCache/Local
    string cachefile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), <database file>);
    
    

    Was this answer helpful?

    0 comments No comments

  2. Brian Conrad 111 Reputation points
    2026-06-26T00:34:40.7+00:00

    I am about to upload an update. It seems that Microsoft pushes having an ARM64 version but I don't have an ARM64 Windows machine since they are more expensive than a gold plated MacBook Pro. Highly unlikely any of my users would have such a PC plus if they do it can emulate the x64 version. I plan to a package flight first to see if it still deletes user data.

    Was this answer helpful?

    0 comments No comments

  3. Jack Dang (WICLOUD CORPORATION) 18,975 Reputation points Microsoft External Staff Moderator
    2026-06-03T06:43:32.01+00:00

    Hi @Brian Conrad ,

    Thanks for your feedback and for sharing the details from your migration experience.

    I would still recommend continuing the migration path, especially since Xamarin is no longer the long-term direction for new development and maintenance. MAUI is the supported path going forward, but for a large existing desktop-style app, it is understandable that the migration can expose packaging, storage, and platform-specific UI issues that need to be handled carefully.

    For the data issue specifically, I would also keep the startup migration/logging checks in place so the app can identify whether it is opening the expected MAUI data location, finding an older Xamarin location, or creating a new database.

    If you run into separate MAUI migration issues, I would suggest opening new focused questions with the Developer technologies | .NET | .NET Multi-platform App UI tag so each issue can be investigated cleanly. We would be happy to help you.

    If my explanation and the information I provided to you were helpful so far, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  4. Jack Dang (WICLOUD CORPORATION) 18,975 Reputation points Microsoft External Staff Moderator
    2026-05-21T03:15:53.0233333+00:00

    Hi @Brian Conrad ,

    Thanks for reaching out.

    There is not a Package.appxmanifest setting that can be added to explicitly preserve user data. For MSIX-packaged apps, Windows keeps app data only when the new package is recognized as an update to the same package identity.

    The first thing I would verify is whether the MAUI package is using exactly the same package identity as the previous Xamarin package. In particular, compare the Identity Name, Identity Publisher, Package Family Name, Store association, and make sure the version number is higher.

    If the name or publisher changed during the migration, Windows will treat the MAUI package as a different app rather than an update. In that case, the previous package may be removed as part of the replacement process, and its data under %LOCALAPPDATA%\Packages\<old package family name> may be removed as well. There is no manifest flag that can force Windows to preserve data across different package identities.

    I would also recommend inspecting the actual .msixbundle that was submitted to the Store and checking the manifest inside the architecture package, especially x64. Sometimes the standalone .msix tested locally has the expected identity, but the submitted bundle contains a package built with a different identity or publisher.

    You can check that with makeappx unbundle and makeappx unpack, then compare the <Identity ... /> element with the one from the previous Xamarin package.

    It is also worth checking whether the data was actually deleted, or whether the MAUI app is now reading from a different location. If the Package Family Name stayed the same, the existing data should normally still be under %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState.

    Going forward, the safest approach is to publish the MAUI app using the exact same Store package identity as the Xamarin app, then handle any internal data migration in the first MAUI release if the storage layout or APIs changed. If the package that was already published used a different identity and the previous package was removed, recovering that local data is usually not possible unless the app had backup, export, or cloud sync in place.

    Hope this helps! If my explanation and the information I provided were helpful, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.

    Was this answer helpful?


Your answer

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