appsettings

Storing values in the web.config - appSettings or configSection - which is more efficient?

I'm writing a page that can use a couple of different themes, and I'm going to store some information about each theme in the web.config. Is it more efficient to create a new sectionGroup and store everything together, or just put everything in appSettings? configSection solution <configSections> <sectionGroup name="SchedulerPage">...

Inject App Settings using Windsor

How can I inject the value of an appSettings entry (from app.config or web.config) into a service using the Windsor container? If I wanted to inject the value of a Windsor property into a service, I would do something like this: <properties> <importantIntegerProperty>666</importantIntegerProperty> </properties> <component id="my...

Best practices for storing UI settings?

hi there, we're currently planning a larger WPF LoB application and i wonder what others think being the best practice for storing lots of UI settings e.g. Expander States Menu orders Sizing Properties etc... i don't like the idea of having dozens of stored values using the delivered SettingsProvider (i.e. App.config file) although ...

How to update appSettings in a WPF app?

Greetings to all! This is my first question here on stackoverflow. I have a WPF application that I am writing for the fellow developers in my department, and there are a couple of settings that I need to check for at startup and update if they are not set (one is the location of an executable on the users computer, we all have it, just...

C# VS.NET 2008 Changing settings per configuration

Is there a way to have different application settings per each build configuration? I would like to be able to batch build a few configurations with different settings, instead of having to change the settings and build, rinse repeat. Thanks in advance! ...

Change Key/Value pairs in Web.config

Hi, How can I change a key's value in web.config which is defined between appSettings tags at code behind in asp.net Thanks.. Regards... ...

C# - Save a ListView through the AppSettings

Good evening, I have set in the AppSettings of my project a ListView object but I have no idea what I should use as value?! Because when I left it blank I can't save anything to my setting property rather the get value is always null after save. Is it possible to do this with AppSettings actually ? Thanks for your answers! Kind rega...

How can I set application settings at install time (via installer class)

I have a Visual Studio setup project that has an Installer class. In the installer class I set a setting as follows: MessageBox.Show(Properties.Settings.Default.MySetting); Properties.Settings.Default.MySetting = "Foo"; Properties.Settings.Default.Save(); MessageBox.Show(Properties.Settings.Default.MySet...

Storing File Path as variable for C# Console Application

I'm trying to create a C# console application that will generate a log file. I'd like to have some flexibility with where the log file will be stored. I tried using the Settings.settings file with: Name: logDrive Type: string Scope: Application Value: C:\Scripts\Logs In my code, I'm using: string logFile = DateTime.Now.ToShortDateSt...

WPF: Bind to a value defined in the Settings

In WPF, Can I use binding with values defined in Settings? If this is possible, please provide a sample. ...

Is IIsreset always neccessary when storing my Web.Config appsettings in a separate file?

Hi everyone. I've got an ASP.Net app in which my AppSettings node from the Web.Config xml is stored in a separate file. So my Web.Config contains this: <appSettings file="AppSettings.config" /> Whenever I change a setting in there I have to do an iisreset to force the changes to kick in. In other words, my changes in this file aren'...

referencing appSettings from usercontrols

In my .ascx usercontrol i'm trying to dynamically generate links using a value i've stored in web.config. <a href="<%$appSettings.MYPATH%>/file.aspx">link</a> and when i try running, i get a parser error Literal expressions like '<%$appSettings.MYPATH %>' are not allowed. Use <asp:Literal runat="server" Text="<%$appSettings.MYPATH%>...

ASP.NET App Settings Directly in Markup

What is the syntax for accessing a AppSettings directly from the ASP.NET Markup? I can't remember exactly, but it was something like '<%= $.settingname %>' ...

C# Application Settings not saving using custom class

Here's the class im trying to store [Serializable] [XmlRoot(ElementName = "Database", IsNullable = false, Namespace = "http://somesite.com")] class Database { [XmlAttribute(AttributeName = "Name")] public string Name { get; set; } [XmlAttribute(AttributeName = "Provider")] public DatabaseProvider Provider { get; se...

What is the difference between app.config file and XYZ.settings file?

I am actually in the learning phase of .NET related stuff and I was exploring how to save the application. I ended up writing my own class which saves the settings in an XML file and then I found that .NET itself supports saving application settings. But I found 2 ways to do that. When I open add new item dialog in Visual Studio 2008, i...

Restoring Window Size/Position With Multiple Monitors

Many posts around about restoring a WinForm position and size. Examples: www.stackoverflow.com/questions/92540/save-and-restore-form-position-and-size www.codeproject.com/KB/dialog/restoreposition.aspx?fid=1249382&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2595746 But I have yet to find code to do this with multiple monito...

Why do people consistently recommend using appConfig instead of using Settings files? (.NET)

Very often I see the answer to the question like: "How should I store settings in my .NET app?" is to edit the app.config file by manually adding entries to the app.config (or web.config) like so: <configuration> <appSettings> **<add key="ConfigValueName" value="ABC"/>** </appSettings> </configuration> Then, accessing them li...

Monitor changes to settings in app.config

When I use typesafe application settings, I have something like this in my app.exe.config file: <setting name="IntervalTimeout" serializeAs="String"> <value>10</value> </setting> The Settings.Designer.vb does something like this: <Global.System.Configuration.ApplicationScopedSettingAttribute(), _ Global.System.Diagnostics.Debug...

Why isn't there an XML-serializable dictionary in .NET?

I need an XML-serializable dictionary. Actually, I now have two quite different programs that need one. I was rather surprised to see that .NET doesn't have one. I asked the question elsewhere and got sarcastic responses. I don't understand why it's a stupid question. Can someone enlighten me, given how dependent various .NET featur...

Confusion about where to store Application Settings in .NET Win apps

I need to know where and how application settings (connections string) could be stored so that they can be changed at run time and saved. I know in VS you can configure settings under Project>Properties and these get stored in the appname.exe.config file under apps install directory.But the "application scope" ones are not read/write at...