0

In my WPF MVVM application I need to check if my application runs first after its installation. I had reviewed some examples in SO and in one of them - how to check whether my c# window app is running first time after installation I found the following code where the author recommended the use of UpgradeRequired:

// this must happen as soon as your program starts, before
// you do anything else with the settings
if (Properties.Settings.Default.UpgradeRequired)
{
    // upgrade FIRST, before doing anything else with the settings
    Properties.Settings.Default.Upgrade();
    Properties.Settings.Default.UpgradeRequired = false;
    Properties.Settings.Default.Save();
}

I quote here his words: "I also suggest adding a "UpgradeRequired" boolean to the settings which is by default true...." But when I try to add the same code in my App.xaml.cs file in OnStartUp event handler then the following error occured: "Settings does not contain a definition for UpgradeRequired" and UpgradeRequired was underlined with a red wavy line. I havn't faced with Properties.Settings before. So I'd like to know: Which assembly reference I should add to my application? What must I do to get access to Properties.Settings.Default.UpgradeRequired? our help would be greatly appreciated.

Community
  • 1
  • 1
Prohor
  • 141
  • 1
  • 3
  • 12

1 Answers1

0

This not in any Assembly it's your oun custom settings. It's all explained here https://msdn.microsoft.com/en-us/library/a65txexh(v=vs.140).aspx

MotKohn
  • 3,485
  • 1
  • 24
  • 41