Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are My.Settings saved in VB 2010 .NET?

Are My.Settings values saved in the program itself or do they get stored in the registry? So, for example, if I set a My.Settings value with a program, then I copy the program itself to another PC - is the My.Settings value still set?

like image 985
Florian Müller Avatar asked Jan 01 '12 04:01

Florian Müller


People also ask

Where are .NET settings stored?

The settings are stored in user. config. Full path: %USERPROFILE%\Local Settings\Application Data\<Company Name>\ <appdomainname>_<eid>_<hash>\<verison>\user.

Where are visual studio settings stored?

Settings. settings is located in the My Project folder for Visual Basic projects and in the Properties folder for Visual C# projects. The Project Designer then searches for other settings files in the project's root folder.

Where are application settings stored?

User-scope settings are stored in the user's appdata folder. Application-scope settings are stored in C:\Users\My Name\AppData\Local\My_Company\. If your settings file doesn't contain any Application-scope settings, you won't have a company folder.

Where is app config in VB net?

config and is located in the bin folder of the application root. An ASP.Net application can contain more than one web. config files at sub-directory level. For applications hosted by the executable host, the config file has the same name as the application, with a.


2 Answers

It depends upon the scope you have selected. There are two scope settings - Application and User scope.

From MSDN article:

Application-scoped settings are read-only and are shared between all users of that application. These settings are stored in the app.config file in the section. At run time, the app.config file will be in your bin folder and will be named with your application's name (MySettingsDemo.exe.config).

User-scope settings are specific for each user. They can be read and set safely by the application code at run time. These settings are stored in a user.config file. To be technically accurate, there are two user.configs per user per application—one for non-roaming and one for roaming. Although the Visual Basic 2005 documentation states that the user.config file will be named according to the user's name (joe.config), this is not the case. The user.config file is created in the:

<c:\Documents and Settings>\<username>\[LocalSettings\]ApplicationData\<companyname>\<appdomainname>_<eid>_<hash>\<verison>.
like image 162
KV Prajapati Avatar answered Oct 20 '22 17:10

KV Prajapati


Dim config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal)
MessageBox.Show(config.FilePath)
like image 21
Axel Esquivel Avatar answered Oct 20 '22 18:10

Axel Esquivel