473,396 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

web config file section replacements

I have been looking into web config file section replacements
I have set it buy putting in the line into the deploy section
connectionStrings=connectionStrings.config;

I then have a file by that name in the root directory

with

<?xml version="1.0"?>
<connectionStrings>
<add name="ioSQL" connectionString="my connection string"/>
</connectionStrings>

if I add another connection string to my web.config it tells me that they
cannot merge so I know that the file is being found, but in debug or release
it uses the same connection string from web.config

Am I missing a step?

Sep 12 '08 #1
3 936
Check:
http://www.eggheadcafe.com/tutorials...-configur.aspx

He explains 2.0 stuff (and beyond) well.
"ThatsIT.net.au" <me@workwrote in message
news:0F**********************************@microsof t.com...
>I have been looking into web config file section replacements
I have set it buy putting in the line into the deploy section
connectionStrings=connectionStrings.config;

I then have a file by that name in the root directory

with

<?xml version="1.0"?>
<connectionStrings>
<add name="ioSQL" connectionString="my connection string"/>
</connectionStrings>

if I add another connection string to my web.config it tells me that they
cannot merge so I know that the file is being found, but in debug or
release it uses the same connection string from web.config

Am I missing a step?

Sep 12 '08 #2
re:
!I have been looking into web config file section replacements
!I have set it buy putting in the line into the deploy section
!connectionStrings=connectionStrings.config;
!I then have a file by that name in the root directory
!Am I missing a step?

You are missing the configSource attribute in web.config :

<connectionStrings configSource="subdirectory/connectionStrings.config"/>

or, if connectionStrings.config is in the root of the application :

<connectionStrings configSource="connectionStrings.config"/>


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"ThatsIT.net.au" <me@workwrote in message news:0F**********************************@microsof t.com...
I have been looking into web config file section replacements
I have set it buy putting in the line into the deploy section
connectionStrings=connectionStrings.config;

I then have a file by that name in the root directory

with

<?xml version="1.0"?>
<connectionStrings>
<add name="ioSQL" connectionString="my connection string"/>
</connectionStrings>

if I add another connection string to my web.config it tells me that they cannot merge so I know that the file is
being found, but in debug or release it uses the same connection string from web.config

Am I missing a step?

Sep 13 '08 #3

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:OX**************@TK2MSFTNGP05.phx.gbl...
re:
!I have been looking into web config file section replacements
!I have set it buy putting in the line into the deploy section
!connectionStrings=connectionStrings.config;
!I then have a file by that name in the root directory
!Am I missing a step?

You are missing the configSource attribute in web.config :

<connectionStrings configSource="subdirectory/connectionStrings.config"/>

or, if connectionStrings.config is in the root of the application :

<connectionStrings configSource="connectionStrings.config"/>


Thanks for your replay and sorry for getting back so late.

if I was to have this in my web.config
<connectionStrings configSource="connectionStrings.config"/>

how would it find the debug file.

If I have 2 files one for debug and one for release, how can I specify both?


>

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"ThatsIT.net.au" <me@workwrote in message
news:0F**********************************@microsof t.com...
>I have been looking into web config file section replacements
I have set it buy putting in the line into the deploy section
connectionStrings=connectionStrings.config;

I then have a file by that name in the root directory

with

<?xml version="1.0"?>
<connectionStrings>
<add name="ioSQL" connectionString="my connection string"/>
</connectionStrings>

if I add another connection string to my web.config it tells me that they
cannot merge so I know that the file is being found, but in debug or
release it uses the same connection string from web.config

Am I missing a step?

Sep 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply*...
4
by: Guinness Mann | last post by:
I'm working in VS2003.NET, with C#. I use app.config to store the connection string to my SQL Server. This works fine. Lately I've been taking work home where the connection string is...
1
by: Rolf Molini | last post by:
Hello everybody, I put this in a separate thread because altough it is connected to the localization-problem in my former thread this is a completely different "joke" of the IDE. While waiting...
2
by: ken | last post by:
We have a user that has reported the following error when starting up our client application that uses a web service on our back end: System.Configuration.ConfigurationException: Missing required...
0
by: Brian McCullough | last post by:
Hello, I have a Web Deployment Project (WDP) for my Web Site Project (WSP) (not a Web Application Project). I put an additional prodAppSettings.config file on my development machine and...
3
by: Blasting Cap | last post by:
I am working on a web app that I want to be able to use a separate config file on, in addition to the web.config file that's already working in the application. If I put the following in the...
3
by: =?Utf-8?B?RHVrZSAoQU4yNDcp?= | last post by:
I've added a web deployment project and want to use the config section replacement but I'm obviously not understanding something. I have set up an alternate appSettings file,...
3
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi I've been reading about various ways in which people can have multiple web.config "sections" for different scenarios (configSource proerty, etc). In my situation, I just have a dev and...
4
by: ThatsIT.net.au | last post by:
Is it possible to detect the build config via code. I want to run a program with a different connection string when in debug config any ideas?
3
by: ThatsIT.net.au | last post by:
I have been looking into web config file section replacements I have set it buy putting in the line into the deploy section connectionStrings=connectionStrings.config; I then have a file by that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.