Questions tagged [applicationsettingsbase]

Use this tag for questions related to the ApplicationSettingsBase Class, of C#.

From MSDN:

acts as a base class for deriving concrete wrapper classes to implement the application settings feature in Window Forms applications.

If you are using this tag, you are encouraged to use if needed.

23 questions
36
votes
3 answers

FileNotFoundException in ApplicationSettingsBase

When debugging an application I always get the following error when break on exception is enabled in Visual Studio. This is really bugging me, since we work with break on exception. The funny thing is, that it still works when I continue (the…
testalino
  • 5,474
  • 6
  • 36
  • 48
22
votes
0 answers

Where does ApplicationSettingsBase save config files during unit testing?

Some background context: I'm deriving from ApplicationSettingsBase to save custom sets of configuration settings in my application, and the manual testing is working fine, the config sets are being saved no problem. I also wanted to unit test my…
Matt Shubert
  • 221
  • 2
  • 5
8
votes
1 answer

.NET ApplicationSettingsBase Should I call Upgrade() every time I load?

We have application settings derived from ApplicationSettingsBase. When we push a new version of our app we need to call: // // Summary: // Updates application settings to reflect a more recent installation of the // application. …
Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
7
votes
1 answer

How do I save a custom class to user settings using ApplicationSettingsBase?

I'm trying to save a custom class to user settings but not having much success. I've created a test project in Visual Studio 2010 with Target framework = ".NET Framework 4". The main Form has two text boxes for displaying and editing a plain test…
user1460663
  • 81
  • 1
  • 3
6
votes
3 answers

Storing generic List using ApplicationSettingsBase

I am trying to save a List using ApplicationSettingsBase, however it only outputs the following even though the list is populated: Foo is defined as…
Vegard Larsen
  • 12,827
  • 14
  • 59
  • 102
4
votes
1 answer

How do you upgrade all settings in user.config when the version number changes?

I have many user scoped settings being stored in user.config by objects which inherit from ApplicationSettingsBase. The SettingsKey for each instance is derived dynamically at runtime using primarily the form name. Therefore there could be…
Stuart Helwig
  • 9,318
  • 8
  • 51
  • 67
2
votes
3 answers

"Type is not defined" when I want to add my custom class as settings type

I want to add this class as setting's type: using System.Collections.Generic; using System.Configuration; namespace MY_PROJECT.SUB_PROJECT { [SettingsSerializeAs(SettingsSerializeAs.Xml)] public class Configs: List { …
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
1
vote
0 answers

Custom Settings with Custom Class - Serialization Issue

I have a custom settings class as below. [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator",…
1
vote
1 answer

MVVM and SettingsBase

Hi i'm currently implement MVVM in a WPF app i'm developing. I implemented the ViewModel and the Views by using 2 separate projects. Only the View is referencing from the ViewModel. However, i've come to a point where i need the information in the…
icube
  • 2,578
  • 1
  • 30
  • 63
1
vote
3 answers

ApplicationSettingsBase ConfigurationErrorsException multiple assemblies

Updated Question (to point out the problem correctly) I'm using a lib, which implements a class that derives from ApplicationSettingsBase. namespace MyLib { public sealed class GlobalLibSettings : ApplicationSettingsBase { …
WPFGermany
  • 1,639
  • 2
  • 12
  • 30
1
vote
1 answer

ApplicationSettingsBase is not serializing my classes as expected

I am attempting to use ApplicationSettingsBase to persist my classes. I have an example here. I also tried without using ApplicationSettingsBase and that seems to work fine. That example is further below. Can someone give me some guidance on using…
bgrupczy
  • 67
  • 1
  • 2
  • 8
1
vote
1 answer

Saving user scoped settings (ApplicationSettingsBase)

I am trying to get my application settings to save when a user exits a configuration form (not my mainform). It will keep the settings in memory because when I open the form again, it will have my data that I configured still there, but it will not…
1
vote
1 answer

.NET SettingsProvider/ApplicationSettingsBase caching

I'm looking at some code that uses the .NET System.Configuration.SettingsProvider and ApplicationSettingsBase to handle configuration. We have a class that derives from SettingsProvider that uses a database as the data store, and then we have other…
Andy White
  • 86,444
  • 48
  • 176
  • 211
1
vote
1 answer

Custom Settings-class exception on first use (ApplicationSettingsBase)

Reading the Settings for the first time (-before they've been set) throws an Object reference not set to an instance of an object. exception. Setting a default value using DefaultSettingValueAttribute cannot be done in the real case because it's not…
ispiro
  • 26,556
  • 38
  • 136
  • 291
1
vote
1 answer

How to read in multiple .settings files and pass them to a method in C#/XNA .Net

I'm trying to read it multiple settings files that I'm using as player settings. C# and XNA They all have the exact same setup. AKA Settings1 has player1's Name, ShipType, Weapon, Shield, Color, etc... (about 100 things) Settings2 has player2's…
Krell
  • 55
  • 1
  • 6
1
2