settings.settings

Can you use Settings.Settings file for ASP.Net sites also?

I have a code base that has been used as an ASP.Net web application. It's now branching out and being used as part of two WinForms applications. The main difference is that the WinForms apps should store their settings "per user" and the web app only needs to store the settings at the "application" level. They are the same settings, bu...

Visual Studio crashes when I add a .settings file in a C++ Windows form application

I'm trying to add a .settings file in a windows form application by adding a (whatever) file in the project and have it named smthng.settings. Right after it is created, it crashes (if I look into the project's directory the file is there, but it's not "in" the project). Am I doing it wrong or could it be that the problem lies elsewhere?...

Saving a string to a .setting variable.

I'm trying to save a string variable from my FolderBrowserDialog.SelectedPath(). Using a breakpoint I can see that the string is correctly loaded onto SelectedPath(), but I can't save that string to the .settings file for the life of me. Any help? public void LocateWoWFolder() { using (FolderBrowserDialog FileDialogWin...

Load a DateTime array into ListBox?

How can I save a Properties.Settings.Default.Array using DateTime format (with just the time)? ...

Save a ListView into Settings.settings?

How can I save a ListView with multicolumns into Settings.settings and load them upon running? I'm trying to save a ListView with 3 columns. How can I do that? ...

Load from Properties.Settings to ArrayList?

Here is the settings file that is leftover from saving. (Saving the properties works correctly.) <setting name="AlarmList" serializeAs="Xml"> <value> <ArrayOfAnyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <anyType xsi:type="ArrayOfAnyType"> <...

C# Enterprise Block Application Settings and Settings.Settings designer

I am working with v4 of the Enterprise Application block and I am trying to learn how to access the Application Settings that I have added using the Enterprise Library Configuration tool. It's as if the code does not recognize the settings even though I can see them in the app.config. I DO have a Settings.Settings designer added and I ...

How to persist changes in a .settings/.config file across a file version change?

I have created an application that uses settings.settings to store some user specific settings (scope=User). Settings are loaded correctly on startup, changed during use and saved correctly for next launch. This cycle appears to have no problems. The problem arises when I update the assembly and file versions for a new build. The set...

Cannot access app.config or settings.settings data

I have a .Net 3.5 application that needs to load a string from settings.settings or app.config. I made sure I have a reference to ConfigurationManager but a very simple call from form load value returns null. Here is the code: void LoadSettings() { // I expect to get from my app.config or settings.settings // Settings file s...

How do I supply extra info to IApplicationSettingsProvider class?

Perhaps this question has been asked before in a different way, but I haven’t been able to find it. I have one or more plugin adapter assemblies in my application all having the type IPlugin, for instance. Each adapter has its own settings structures stored in a common directory. Whether they are stored in one contiguous file or in s...

How do I invoke my custom settings provider?

I need to specify a different location for my settings file. After many long hours of searching, I found out that I have to write my own SettingsProvider. I succeeded in creating one which allows me to specify a path for settings file via its constructor. Programatically, I can contruct it like this: var mycustomprovider = new CustomS...

Load a Settings.settings into ListView?

Hi, I've managed to save ListView items to a System.Collections.Specialized.StringCollection property settings using this LINQ one liner: My.Settings.Property1.AddRange(ListView1.Items.Cast(Of ListViewItem)().[Select](Function(a) String.Join(Convert.ToChar(Keys.Tab), a.SubItems.Cast(Of System.Windows.Forms.ListViewItem.ListViewSubItem)(...

How do I store an array of a particular type into my settings file?

For some reason, I can't seem to store an array of my class into the settings. Here's the code: var newLink = new Link(); Properties.Settings.Default.Links = new ArrayList(); Properties.Settings.Default.Links.Add(newLink); Properties.Settings.Default.Save(); In my Settings.Designer.cs I...

Where should I store my application data?

I have an application that needs to store data. Currently, I am using the built-in Application Settings to do it, but it only gives me two choices: application and user scopes. Ideally, I want a "local" scope that allows the application to run under another user and still find its data rather than recreate it for that user. The applic...

VisualStudio 2010 Settings Page - Collection Settings

I have a list of Filemaker database names Each DB name has a list of field/attribute pairs associated with it I have a windows form application in C# 4.0 (vs2010) that wants to use the above data I would like to maintain the list either in the Visual Studio settings page, or in one of the standard visual studio settings files using the...

When to use .NET Settings vs config <appsettings>?

Are there any recommendations on when to use Application settings (not per user settings) vs. .config file <appsettings>? Update Looking to understand some of the finer and important differences because they're both effectively key/value stores. For example, I know modifying appsettings in web.config will recycle the web application. ...

Properties.Settings Ambiguity after adding LINQ to SQL

I have recently linked a database to my C# service by creating a LINQ to SQL item in my solution. Everything was fine and dandy as I was continuing to code, but then I suddenly noticed that there where 16 Ambiguity errors. e.g. Ambiguity between 'EmailService.Properties.Settings.defaultInstance' and 'EmailService.Properties.Settings.d...

How do you save an object to a fooSettings.settings file in Visual Studio?

Can you save an object to a settings.settings file in Visual Studio? If so how? I think you can make your object serializable and it should persist, but I'm not sure if I'm doing it right i.e. when I try to get the object back it is always null. Here is the code: [Serializable()] [XmlRoot(ElementName = "LayerTCA", IsNullable ...

Visual Studio Settings.settings file

Is there a way of creating a new setting in the Settings.settings file during run time? For example, I want to write to the settings file from one class function, and read that value from a different class function. And no, I don't want to pass the values. I know how to get values from the Settings.settings file (value = Properties.Se...

.settings file in web application

Does a .settings file work in a web application? If I right-click my project and choose Add > New Item..., I don't have the template listed. If I do the same thing in a class library it is. Am I missing anything? ...