![]() ![]() Your program can modify and save user-scope settings, thus allowing each user to have his/her own settings. If you turn this off (by setting the file's properties), you can change a setting by directly editing the file in the build directory.Īpplication-scope settings are read-only. (If you look at the property accessors in the generated code in Settings.cs, you'll see that they're marked with an attribute containing the default value of the setting that's in your app.config file.) If you change a setting by editing the app.config file directly, Settings.cs won't be updated, but the new value will still be used by your program when you run it, because app.config gets copied to at compile time. If you change a setting through the VS settings editor, it will update both app.config and Settings.cs. NET configuration manager looks for when it retrieves settings at runtime. if your executable is named foo.exe, the file will be named ), which is the name the. It also builds the Settings.cs file that provides the static accessors to the individual settings.Īt compile time, VS will (by default you can change this) copy the app.config to the build directory, changing its name to match the executable (e.g. When you add settings to a project, VS creates a file named app.config in your project directory and stores the settings in that file. Assuming that you're talking about desktop and not web applications:
0 Comments
Leave a Reply. |