Questions tagged [app-config]

.NET application configuration files contain settings specific to an application.

Application configuration files contain settings specific to an application. This file contains configuration settings that the common language runtime reads (such as assembly binding policy, remoting objects, and so on), and settings that the application can read.

The name and location of the application configuration file depend on the application's host, which can be one of the following:

Executable–hosted application.

The configuration file for an application hosted by the executable host is in the same directory as the application. The name of the configuration file is the name of the application with a .config extension. For example, an application called myApp.exe can be associated with a configuration file called myApp.exe.config.

While developing with Visual Studio the file app.config in a project will be copied to the correctly named configuration file when the project is built.

The file can contain both framework defined and user defined elements (possibly using .NET types to read and write the content).

ASP.NET-hosted application.

ASP.NET configuration files are called web.config. Configuration files in ASP.NET applications inherit the settings of configuration files in the URL path. For example, given the URL http://www.example.com/aaa/bbb, where http://www.example.com/aaa is the Web application, the configuration file associated with the application is located at www.example.com/aaa. ASP.NET pages that are in the subdirectory bbb use both the settings that are in the configuration file at the application level and the settings in the configuration file that is in bbb.

For more information about ASP.NET configuration files, see ASP.NET Configuration

Internet Explorer-hosted application. If an application hosted in Internet Explorer has a configuration file, the location of this file is specified in a tag with the following syntax:

<link rel="ConfigurationFileName" href="location">

In this tag, location is a URL to the configuration file. This sets the application base. The configuration file must be located on the same Web site as the application.

3121 questions
1
vote
1 answer

Accessing multiple sections in AppConfig

I have an AppConfig file as shown below. I am trying to loop through the configsections and get the section name, based on the section name, it should select the appropriate appSettings. For example, when the first section is VehicleConfig, it…
user3447653
  • 3,968
  • 12
  • 58
  • 100
1
vote
0 answers

BaseDir in app.config file, like WCF baseadress

Hi would like to use an attribute within another attribute, like WCF baseadress. My app.config file is like below. I've added a new section named BaseDir and then I would like to use it in an other section.
ilhan
  • 125
  • 2
  • 13
1
vote
1 answer

Extend an element in App.config

We have an app.config we are using with Carbonator:
lhoworko
  • 1,191
  • 2
  • 13
  • 24
1
vote
1 answer

Find location of user.confi?

I know that there is some questions about this already but none of them have helped me. So I have a .NET c# application that have settings in its app.config like this :
Banshee
  • 15,376
  • 38
  • 128
  • 219
1
vote
1 answer

Is updating app.config manually a good idea?

I'm updating a C# application to .NET 4.0. The older application uses several third party DLLs which are needed to be upgraded from version 2509.0.0.0 to 3396.0.0.0. In the older application, the app.config file contains several of the following…
Donotalo
  • 12,748
  • 25
  • 83
  • 121
1
vote
0 answers

In an app.config file, can keys be nested?

I'm writing a program that is using the section of the app.config file to get the variables. Here's an example of my situation currently: string ip = ConfigurationManager.AppSettings["IP"]; string var1 = …
Alamb
  • 137
  • 1
  • 10
1
vote
1 answer

XmlWriter passed to ConfigurationElement.SerializeElement is always null on Configuration.Save

When extending System.Configuration.ConfigurationElement and overriding the DeserializeElement eveything works as expected and can get what I need from it the XmlReader that is always provided and functional. Unfortunately when I override the…
Rodney S. Foley
  • 10,190
  • 12
  • 48
  • 66
1
vote
0 answers

maxReceivedMessageSize property performing different across environments

We have three identical test environments set up. On each of these environments, we have an application that, when you hit a submit button, grabs text from a form and turns it into an XML and then sends it to a WCF to be inserted into our Oracle…
1
vote
0 answers

C# Configure App.config to specify environment

I have downloaded a C# Page Object project from Github from the following location: https://github.com/PaulSodimu The program uses an app.config file to identify the page objects to load. What I'd like to do is this: Configure the app.config file to…
Kenito
  • 53
  • 2
  • 10
1
vote
3 answers

Visual C# app.config file for a referenced assembly

We have a Visual Studio 2010 solution that contains several C# projects in accordance with Jeffery Palermo's Onion Architecture pattern (http://jeffreypalermo.com/blog/the-onion-architecture-part-1/). We have a UI project that is an ASP.Net MVC…
Russ Clark
  • 13,260
  • 16
  • 56
  • 81
1
vote
0 answers

app.config transformation and installation folder url - update location

Is there a way to change the installation folder url and the update location of an application depending on the current configuration, in the same way you can change app.config properties with app.config transformations?
Vagelis Ouranos
  • 482
  • 3
  • 14
1
vote
1 answer

App.config doesn't save some changes after app relaunch

I have a next App.config file:
whizzzkey
  • 926
  • 3
  • 21
  • 52
1
vote
0 answers

Is it possible to programmatically write to the setting in an app.config file?

I am writing a small "Configuration" library for some of our products. The idea is to construct an app.config file programmatically (typically using another program, at install time). I would like to be able to write a new setting into this field…
Philip Daniels
  • 994
  • 1
  • 7
  • 25
1
vote
1 answer

Reading data from excel into app.config

I am new to .net and C# and facing difficulty in modifying app.config. In my app.config file, I have: Normally this information is given manually, when asked for, in the…
1
vote
1 answer

How can I write end point programmatically (netPeerTcpBinding)

I need to write this end proint programatically in c# , this is for a chat application . app.config part
1 2 3
99
100