app-config

Custom Config file with subelements instead of attributes

I am working on making a custom section of my app.config and web.config to read a configuration in. I'm following the code at http://consultingblogs.emc.com/pauloreichert/archive/2005/05/31/1514.aspx for my sample. The problem is, my config file generates as follows: <configSections> <section name="BizDays" type="Holidays.BizDaysS...

need mbsuild task to combine app.config files

does anyone know of a solution here? Combine select app.config files into one app.exe.config file. ...

Can't get values from App.config file (framework 4.0)

Hello, i have a config file like this: ?xml version="1.0" encoding="utf-8" ? configuration appSettings add key="PortName" value="COM4" add key="BaudRate" value="9600" add key="DataBits" value="8" appSettings configuration ... and then i want to access app.config values with this code: using System; using Syst...

Change to app.config while running unit test

I want to run some unittests. For this tests I need to use another value from the app.config file then the default value. In this post "Reload app.config with nunit", I found a solution. However when running multiple test at once, some test fail, because the old configuration file (app.config) is not called after disposing the function...

Configuration Element Collection Section

I would like to set up a custom app configuration element collection section like this ` <logSection name="Testttt"> <properties name ="Pride"> <pathName="TestingLog.txt"/> <deleteRetention="100"/> <deleteZeroRetention="5"/> <wildcard="*.txt"/> </properties> <properties name ="Adhoc"> ...

What is the difference between an "Application Configuration File" & "Settings File" in C#?

What is the purpose of having two files that appear to do the same/similar thing? Is one deprecated and should I be using the other? Please, break it down for me. Thanks! ...

Is there a difference between loading a value from the app.config to loading it from an object?

This is my app.config: <appSettings> <add key="PreRootFolder" value="D:\" /> <add key="RootFolder" value="webSite" /> <add key="Folder" value="folder_a" /> </appSettings> Since I prefer to build the path in the application rather than have many keys for each part of the path... (hard to maintain) so I build the pat...

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 project, and we have a C# Class Library project called Infrastructure that is referenced by t...

app.config in .Net3.5

Hi, I'm not able to write to the App.conf in .Net3.5. According to this question it goes like in .Net2.0, but it doesn't work. I can read from the config like this: var connStr = ConfigurationManager.ConnectionStrings[ApplicationConstants.CisConnectionStringName].ConnectionString But it's impossible for me to write in that file, b...

Looking for a Delphi library/component to read .Net app.config files

Subject line says it all really. Some Googling has revealed a puzzling lack of relevant information. Some pointers to an existing implement would be great! Raymond. ...

How to change location of app.config

I want to change the location where my application looks for the app.config file. I know that I can use ConfigurationManager.OpenExeConfiguration() to access an arbitrary config file - however, when the .Net Framework reads the config file (for ConnectionStrings or EventSources, for instance), it will look at the default location. I ...

How can I read/write app.config settings at runtime without using user settings?

I'm looking for a way to store application or machine level settings that can be written to at runtime using Application Settings. User settings allow read/write but application settings do not. I have been using user settings for saving settings like this at runtime but this has really proven to be impractical for the following reasons:...

ConnectionString from app.config of a DLL is null

I have a class library that contains a valid connectionString inside the app.config. Inside that class library I want to use it with ConfigurationManager.ConnectionStrings["NAME"].ConnectionString My ASP.net 4.0 framework application references that DDL and retrieves data from it. I want create a Entity Framework 4 DataContext within ...

Connection string not found when trying to query database under SubSonic

I get this error no matter what version of SubSonic I use. When I query the database for data, it errors out, saying it can not connect to the database. However, it is able to generate the .cs classes(ActiveRecord, Context, etc) when told to do so. Any help is appreciated. Thanks folks... ...

How to Read Application.Setting from referenced Class Library

Scenario: I have 2 Projects, MainApplication (which compiles to an exe) and ClassLibrary1. Now MainApplication references or loads ClassLibrary1, but ClassLibrary1 has no idea about MainApplication. But I want to use Settings (Dot.Net 2.0's Properties.Settings NOT appSettings) that are defined in MainApplication. How do you achieve thi...

Configuring log4net in a VSTO

I've set up my VSTO Excel add-in to use log4net for logging. Unfortunately I'm (seemingly) not able to make it configure itself from the app.config (which I deliver together with the add-in via ClickOnce). I have read http://www.darinhiggins.com/?p=13 which lists some ways to get the file name of the app.config and then configure log4ne...

Consume a SOAP web service without relying on the app.config

I'm building a .NET component that will call an external web service. I used the "Add Service Reference" dialog to add the web service to my component, which generates the code needed to consume the service and adds the settings to the app.config file. I'm testing the component by adding a reference to its DLL from a Console applicatio...

developer specific app.config/web.config files in Visual Studio

Hi, we have several .net projects where we store certain settings in config files. Now each developer will have their own config files that differ a little (different connection strings to connect to local db, different wcf endpoints etc.) At the moment we tend to check out app/web.config files and modify them to suit our needs. This le...

How to set maxArrayLength in .Net service?

in client i do it in app.config : <basicHttpBinding ... <binding ... <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="50000" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> ...

Use connection string from different project when using Entity Model

I have a application that uses Entity Framework. I have added some custom tables to the application's db and want to map those tables in a different project using EF model and the POCO entity generator template. My separate project needs to be reusable so I will not know the username/password for the connectionstring. How can I use th...