Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2003, 12:32 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using multiple configuration files

Hi,

I need to be able to change between configuration files easily. The best way I think is to use multiple links to my application which supply the filename on the command line.

I tried the following (C#):
Code:
public static void Main(string[] args)
{
    if (args.Length > 0)
        AppDomain.CurrentDomain.SetupInformation.ConfigurationFile = args[0];

    // Continued...
}
But the value of the ConfigurationFile property does not change so I look in the Help:
Quote:
quote:This property cannot be changed after the AppDomain has finished its first bind.
How can I get around this?


Hoping for ideas...
Johan





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Application Configuration Files semilemon C# 2005 17 April 24th, 2007 10:27 PM
Configuration Override Files Jeff Mason Visual Studio 2005 1 March 14th, 2007 08:52 AM
Configuration files and performance ernestlambert BOOK: ASP.NET Website Programming Problem-Design-Solution 1 April 21st, 2005 11:23 AM
Configuration files hasanali00 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 23rd, 2005 09:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.