Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Problems with Application.Current.Properties...

$
0
0

Hi all

I have XF 1.3.0.6286-Pre-4 installed.
With an earlier version of XF (1.3.0 Pre-release 1 without documentation), I have (not successfully -> app-crashes) tried, to store application-settings persistent via Application.Current.Properties….).
Now, I want to implement it correct according to the (small) documentation:
developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/app-lifecycle/#Properties_Dictionary

Problem-description:
As soon as I want to access the Properties, the app (on WP) crashes with “System.AccessViolationException - Attempted to read or write protected memory. This is often an indication, that other memory is corrupt”.
The crash happens by code-line:

if (!Application.Current.Properties.ContainsKey("iWebServerAuswahl"))

(note: the app also crashes on Android as soon as I activate the “if”)

If the key is found, I then want to overtake the value in an integer (public) variable.
If the key is not found I then want to set the key (and the public variable) with a default-variable.
However, as I wrote, the app crashes already by the If-statement (before I can read/write the value).

First, I thought that there are some permissions missing (in WMAppManifest.xml)...
However, I don’t see special permissions to that theme...

I think, the file/whatever in which the settings are stored, is corrupt (as negative side effect from my earlier tests).

Now I want to clear/delete the settings (file).

Strange wise, it don’t help, if I remove the whole app manually from the WP-Device (Lumia 930) and deploy it once again… so - for me - it looks like a problem in my project.

How can solve this problem?

Thanks for any feedback


Viewing all articles
Browse latest Browse all 77050

Trending Articles