Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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 January 9th, 2007, 06:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default Configuration Override Files

In VS2003, one could specify a "Configuration Override File" in a Project's Configuration Properties\Deployment tab which would be used to override/replace the app.config (generated as myexe.exe.config) with the specified config file when a deployment project was built.

I am trying to find the equivalent capability in VS2005. The Project's Deployment tab seems to be gone, and I can't find anything in the deployment project which looks like it.

Can anyone help, or give me some guidance as to how to achieve the
equivalent result in VS2005?

Thanks

Jeff Mason
Custom Apps, Inc.
[email protected]
__________________
-- Jeff
 
Old March 14th, 2007, 08:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Lots of views, no replies. :(

I have an answer, of sorts.

After some conversations with some MS folks, I found that in its infinite wisdom, MS removed this option in VS2005. They mumbled something about Team Server and the problems this option caused managing config files in the Team Server environment.

They are also reconsidering that decision, though I wouldn't hold my breath...

In any case, we got around this via a hack by creating a number of app.config files, one for each build configuration. For example, I created an app.test.config and app.release.config which corresponded to the settings required for the test and release builds.

Then, I created a set of pre-build event commands which tested the about-to-be-built configuration and copied over the appropriate app.<build>.config over the app.config in the project, as:

IF $(ConfigurationName)==Debug (COPY /Y "$(ProjectDir)app.dev.config" "$(ProjectDir)app.config")
IF $(ConfigurationName)==Release (COPY /Y "$(ProjectDir)app.release.config" "$(ProjectDir)app.config")
IF $(ConfigurationName)==Test (COPY /Y "$(ProjectDir)app.test.config" "$(ProjectDir)app.config")

This insured that the appropriate app.config was available at build time for the installation/deployment project.

The app.<build>.config files are under source control, app.config is not, so it can be overwritten.

Bah.

Jeff Mason
Custom Apps, Inc.
[email protected]





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Application Configuration Files semilemon C# 2005 17 April 24th, 2007 10:27 PM
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
Using multiple configuration files Johan VS.NET 2002/2003 0 November 10th, 2003 12:32 PM





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