0
votes

I am new in windows phone development. Now I am trying to study about isolated storage settings. I googled about isolated storage settings and did a sample as i understood. But its showing a compile error. I know its a very simple error.

In the line

var names = IsolatedStorageSettings.ApplicationSettings; // Here it showing an error that 

"The type or namespace name 'ApplicationSettings' does not exist in the namespace 'IsolatedStorageSettings' (are you missing an assembly reference?)".

I imported the class libraries. But still the problem exists.

I have pasted my code below.

Thankx.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.IO.IsolatedStorage;
using System.IO;

namespace IsolatedStorageSettings
{
    public partial class MainPage : PhoneApplicationPage
{
   // Constructor
    public MainPage()
    {
        InitializeComponent();

        var names = IsolatedStorageSettings.ApplicationSettings;
        names.Add("myName", "Developer John");

        displayText.Text = names["myName"].ToString();
    }
}
}
1

1 Answers

5
votes

In Your code "namespace IsolatedStorageSettings" this line is culprit, as your trying to give same namespace name to your application is overriding the included namespace class "System.IO.IsolatedStorage.IsolatedStorageSettings"

I guess your project name is IsolatedStorageSettings, so it creates the namespace as "IsolatedStorageSettings"

So please , rename your application namespace, or try to create another new project with different name then it works for you.