I am not able to write "Properties.Settings.Default". It is not coming in the dropdown list. Is there any namespace that we can add?
-
what type of application is it ? is it console based or winform based ? – bkdev Feb 15 '16 at 05:21
-
Winform based application – B.Vyas Feb 15 '16 at 05:26
5 Answers
An additional hint on top of the above answers:
Go to solution explorer -> Properties folder -> Settings.settings -> Settings.Designer.cs file
and see which namespace is being used there. Ensure that you are using this namespace in your code file as others have suggested

- 432
- 4
- 9
Add your project namespace to the Properties namespace. The default namespace defined in the project settings.
For instance if your project default namespace is MyApp.
MyApp.Properties.Settings.Default

- 46,289
- 20
- 116
- 131
-
"Properties" is not suggested in dropdownlist.. Is there any particular namespace for it?? – B.Vyas Feb 15 '16 at 05:31
-
Look at your project settings and find the default namespace for your project. For instance if it is "MyApp" try MyApp.Properties.Settings.Default – CharithJ Feb 15 '16 at 05:32
Make sure you are on the same namespace and try to access the properties like this :
namespace.Properties.Settings.Default
or if you are on different namespace don't forget to use
using namespace

- 89
- 7
Once you setup your environment in the settings under properties of the app. You want to reference it to the project like this:
using App.Properties.Settings
Then in the code you write you can use as example:
userName.Settings.Default
In this case userName is set within the settings.

- 117
- 12
Set your Setting in your project go to Project => property => go to setting
Set your element (string,int, ecc...)
Save from program all values
Properties.Settings.Default.User = txtUser.Text; Properties.Settings.Default.Password = txtPass.Text; Properties.Settings.Default.Save();
if you use Windows 10, this is the directory of setting Values: C:\Users\AppData\Local<ProjectName.exe_Url_somedata>\1.0.0.0<filename.config>

- 31
- 1