app-config

ASMX: setting the website at runtime

When I am adding the "Web Reference" we are giving the address to the asmx page to visual studio. How Can I set this at run time? ...

App.Config Transformation for Visual Studio 2010?

For Visual Studio 2010 Web based application we have Config Transformation features by which we can maintain multiple configuration files for different environments. But the same feature is not available for App.Config files for Windows Services/WinForms or Console Application. There is a workaround available as suggested on the follow...

Can I share some config sections in one common app.config file? .net

I have 2 projects that share some appSettinsg and config sections. Let's say : ProjectA has it's own app.config that contains its unique settings/config sections. ProjectB ditto... Now in each app.config I want to point to a third shared .config file that contains some common appSettings AND config sections, used by both ProjectA and...

.NET: How .config files works?

For me it a little bit hard and frustrating to understand how app.config, web.config files work on deep level. Is it any document which can describe format, internal implementation and parsing of .config file. ...

Getting name of configuration section registered for a certain type in .net

I have a custom configuration section for a library, and I would like to load my configuration object from the library itself. Am I obliged to fix the configuration section group and name, e.g. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="MyGroup"> <section name="MySection" typ...

setup proxy app.config in .net

I am having much problems setting up the proxy through app.config. I want 2 ip address to go through my proxy on my local computer. From what i can tell i need to set a proxy then set a bypass list. So i figure .* will match everything and i'll just remove the two i want. So i wrote the below and the 2 ip address (i realize the 2nd is a ...

UnauthorizedAccessException app.config c#

First I create a setup from a project, and I install it. When the program reads and writes from app.config, I get an UnauthorizedAccessException. This works perfect in visual studio, but with creating a setup and installing it, it always crashes at this point. Someone who knows how to solve this? Thanks ...

How to catch exception when loading .NET WinForm app user.config file?

Sometimes in .NET (2.0) WinForm desktop apps which use the default configuration system, the user.config file will become corrupted and can't be loaded anymore (when the configuration system tries to load it, it'll throw a System.Xml.XmlException). Putting aside the question of "why did the file get corrupted in the first place" (maybe ...

ConfigurationManager.RefreshSection("AppSettings") doesn't work

I am trying to get a (ClickOnce deployed) application to read the non-default config file, depending on an environment variable set on the _envName = System.Environment.GetEnvironmentVariable("ENV"); if (_envName == null) throw new Exception ("The ENV environemnt variable must be set"); string envFileName = "app." + _envName.ToLow...

The right way to use Globals Constants

In almost every project, I can't decide on how to deal with certain global constant values. In the older days, when I wrote C++ programs which didn't used dll's, it was easy. Just create and .h file with a number of const that described certain constant values for my project. Then I had every file include it, and ta-da! It worked. Clean,...

WCF client from VBA

In .NET, I have developed a client library for my WCF service. I have registered the assembly for COM interop so that I can make calls to the library from VBA. However, since the executable using the library is not built in the .NET setting, library functions are unable to find the config file that defines the service bindings ('app.co...

.NET - Storing An App.config With A Class Library

This seems to be asked a lot on the internet, but so far my research hasn't produced a solution. (And, at least for now, I haven't accepted "it can't be done" as a solution.) At its simplest description, what I'm trying to do is have a config file in a .NET class library project that is available to that class library in any applicatio...

Encrypt the configuration group System.ServiceModel in App.config

We are deploying a client app and need to encrypt the system.serviceModel configuration group. I have been searching on StackOverflow for the better part of the day for the best way to do this and most responses have either been "rename app.config to web.config, encrypt with the ASP.NET utilty, and deploy" or "override the install metho...

Including app.config in setup output

I have a solution with several projects: MyLibrary (a VB.NET dll) .dll app.config MyService (C# Windows Service with ProjectInstaller) .exe app.config MyGui (C# WinForms app) .exe I've added a setup project and added primary outputs of all three projects. I've added all three project outputs to custom action section. The thi...

Can Web.config transformations be used with App.config files?

Sorry folks, my search fu was low when looking for a version of this question. It's asked and answered here: http://stackoverflow.com/questions/3004210/app-config-transformation-for-visual-studio-2010 Basically, the question above. The new config transformations that are provided for a web.config file for different environments are re...

How to get admin privileges for editing app.config in C#?

Hello, I've got a program which uses app.config for storing some preferences. The problem is that if the program is installed in C:\program files\<project name> then the changing of preferences is not possible due to the fact that all files in program files\<project name> are available only to administrator. My code: public static...

same app.config : wcftestclient work, selfHosting doesnot

i have the same app config on both programs A - the service itself when i run it , wcf Test Client starts. B - A self host program using -new ServiceHost(typeof(MyService))) here it is : <services> <service name="MyNameSpace.MyService" behaviorConfiguration="MyService.Service1Behavior"> <host> <baseAddresses...

Alternative to XML Serialization for Configuration

Currently, we use a giant configuration object that is serialized to/from XML. This has worked fine for the most part, but we are finding that in the case of power loss and application crashes, that the file could be left in a state that renders it unable to deserialize properly, effectively corrupting the configuration information. I w...

app.config "Could not find schema information" after converting to Visual Studio 2010 / .Net 4.0

After upgrading my project to Visual Studio 2010 and .Net 4.0, my app.config file generates these messages upon building the project: Could not find schema information for the element 'supportedRuntime'. Could not find schema information for the attribute 'version'. Could not find schema information for the attribute 'sku'. Here is m...

ConfigurationManager Class and On Demand configuration changes

Are there any events that will fire if someone edited my custom made application config? I wanted to know such changes and apply it on my application. ...