app-config

Shall I deploy app.config with my installer?

As far as I understand all default settings of app.config settings is hard coded in the application and will generated on the fly in the first run. If this is true then there is no good reason to deploy these files with an installer or in a zip package, am I right? Or am I missing something in here. I want to be sure before rolling out...

subsonic in visual studio design host

Hi, I'm facing currently a problem regarding Subsonic configuration. What I want to achieve is using subsonic data access in a System.Web.UI.Design.ControlDesigner class. This class is hosted in Visual Studio Environment and enables design time operations on the attached System.Web.UI.WebControls.Control. The only problem is Sub...

Accessing the settings (app.config) of the calling application

I have a WinForms application ("WF"), and a Library called by that WinForms application ("LIB") WF has a Settings.settings (Visual Studio Designer) and app.config combo. I gather than the designer is a front end that auto generates the app.config file. To use those settings from within WF, I use the strongly typed properties of the clas...

Class library with service references

Hi! I have a class library (.NET) with a reference to a web service (in some server, not a project in the same solution). The class library has a class that is exposed to COM. This class invokes the web service. When I add the service reference, this adds code to the class library's app.config. I also have a desktop application in the...

Is there any way to specify a service name in the app.config file?

I want to specify my service name in the app.config without needing to recomple and install/uninstall my service repeatedly. But just retrieving service name from app.config, the service seems ignoring it. Are there any special tricks how to obtain this? Thanks in advance. I mean classic windows service. I don't think any code is neede...

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...

Create an app.config for an Assembly

I have a .NET assembly for a COM-visible component that I want to use some configurations. I know that applications use the app.config, but is it a violation of best practices to create and use an app.config for my assembly?? ...

How to Read Custom XML from the app.config ?

I want to read the custom XML section from the app.config of a C# windows service. How do I go about it? The XML is below: <Books> <Book name="name1" title="title1"/> <Book name="name2" title="title2"/> </Books> ...

NameValueSectionHandler - can i use this section type for writing back to the application config file ?

back to the topic of why didn't .net provide a simple (i don't want to implement "ConfigurationSection" "ConfigurationElement" "ConfigurationProperty" for 2 values) way to write values back into application config files... (and i don't want to use 'user' app config) i want to write to the app.config values, i tired the above method of k...

unable to save settings in app.exe.config

hi.. i am facing one problem. i want to save settings in app.config file i wrote separate class and defined section in config file.. but when i run the application. it does not save the given values into config file here is SettingsClass public class MySetting:ConfigurationSection { private static MySetting settings = ...

Conditional .NET application settings.

Dear ladies and sirs. I have a client-server application, where there two options for the server - standalone executable or in another AppDomain in the client, which is very convenient for the debugging purposes. The choice of the server is transparent to the client, the only file that needs to be changed is the client app.config. In o...

Is it possible to split a string across multiple lines in an XML file? If so, how?

I've got an XML config file with some really long strings. Generally, I format my source files, etc. so that they can be read without scrolling. I'd like to do the same to this config file. Is there a way to split the string across more than one line? Hopefully, what I'm asking for is obvious but a picture says a thousand words so, e...

how to save configuation in app.config in c# winform

someone to example coding me thank key and value save in app.config ...

Load parts of App.Config from another file

I like to split my app.config into a user specific part and an application specific part. Is it possible to store a part of the app.config in another file? I allready tried this: <!DOCTYPE cruisecontrol [ <!ENTITY email SYSTEM "email.config"> ]> but this does not load. Is there another possiblity without changing the application its...

Automatically "upgrade" user settings from previous version of app.config file?

Every time I compile my app and the version number changes (I have an auto-incrementing build number), I lose the user-configured app.config settings, since they're stored in the AppData folder for a specific version. Essentially, every release of my application starts from scratch as far as user settings go. While this is a mild annoya...

What would be the best way to persist user-editable settings for a Windows Service?

I'm developing an application that's going to be implemented as a Windows Service and I was wondering what'd be the best way to deal with the different settings (at User and Application level). The thing is, I'm not completely familiar (yet) with all the available options, so in principle I'm favoring .NET's own System.Configuration (Con...

How to get assembly version of another project from app.config ?

I have two projects in a Visual Studio solution. I need an application setting in one of them to be the version number of the other project's assembly. I thought of adding to my project1's app.config something like: <setting name="currentVersion" serializeAs="String"> <value> !(bind.project2.Assembly.FileVersion) </value> </set...

Prevent .NET config file being overwritten during install

I'm using InstallShield 2010 Express to install a .NET WinForms app. The latest InstallShield project is a major upgrade, so I've used the Upgrade Paths section to allow upgrades from earlier versions of my app. The problem is that config settings made during the initial install (written to Program Files\MyCompany\MyApp\myapp.exe.confi...

Why would adding an **appSettings** section to App.config cause an error in WPF application?

In my WPF application (Composite Application) I want to store a variable in the App.config file, but as soon as I add an appSettings section in App.config, it gives me this error: The type initializer for System.Windows.Application threw an exception. App.Config: <?xml version="1.0" encoding="utf-8" ?> <configuration> ...

Deploying to more than one application server

We have reached that point where one application server is not enough. Apart from performance benefits we want to have a somewhat failover scenario as we cannot afford a 30 minute downtime just because the server needs a reboot for the new kernel. The first issue that has to be resolved is where to store the shared files so that both ...