Bug 18947 - Private data frequently erased when debugging
Summary: Private data frequently erased when debugging
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: 4.12.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2014-04-11 06:23 UTC by taquet_karim
Modified: 2015-01-12 11:45 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description taquet_karim 2014-04-11 06:23:14 UTC
Private data (DB, SharedPreferences, ...) are deleted frequently when we are debugging our Xamarin.Android App. This does not happen always, but approximately once every two debug sessions. When we deploy a new version of the App to the device without the debugger attached, the private data is not deleted.

This looks like a bug for us.

We use the latest version of Xamarin.Android with Visual Studio 2013 (Update 1)

Thanks in advance for investigating!
Comment 1 dean.ellis 2015-01-12 11:45:10 UTC
There is a setting which you can use to preserve the private data between builds. In Visual Studio go to 

Tools->Options -> Xamarin -> Android Settings 

Make sure "Preserve application data/cache on device between deploys" is checked.

What was probably happening was the .apk was being rebuilt which resulted in the app being uninstalled and the cache removed. Using this flag should fix that issue.