473,672 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
connectionStrin gs=connectionSt rings.config;

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

with

<?xml version="1.0"?>
<connectionStri ngs>
<add name="ioSQL" connectionStrin g="my connection string"/>
</connectionStrin gs>

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 1634
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******** *************** ***********@mic rosoft.com...
>I have been looking into web config file section replacements
I have set it buy putting in the line into the deploy section
connectionStrin gs=connectionSt rings.config;

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

with

<?xml version="1.0"?>
<connectionStri ngs>
<add name="ioSQL" connectionStrin g="my connection string"/>
</connectionStrin gs>

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
!connectionStri ngs=connectionS trings.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 :

<connectionStri ngs configSource="s ubdirectory/connectionStrin gs.config"/>

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

<connectionStri ngs configSource="c onnectionString s.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******** *************** ***********@mic rosoft.com...
I have been looking into web config file section replacements
I have set it buy putting in the line into the deploy section
connectionStrin gs=connectionSt rings.config;

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

with

<?xml version="1.0"?>
<connectionStri ngs>
<add name="ioSQL" connectionStrin g="my connection string"/>
</connectionStrin gs>

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.comwrot e in message
news:OX******** ******@TK2MSFTN GP05.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
!connectionStri ngs=connectionS trings.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 :

<connectionStri ngs configSource="s ubdirectory/connectionStrin gs.config"/>

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

<connectionStri ngs configSource="c onnectionString s.config"/>


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

if I was to have this in my web.config
<connectionStri ngs configSource="c onnectionString s.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******** *************** ***********@mic rosoft.com...
>I have been looking into web config file section replacements
I have set it buy putting in the line into the deploy section
connectionStri ngs=connectionS trings.config;

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

with

<?xml version="1.0"?>
<connectionStr ings>
<add name="ioSQL" connectionStrin g="my connection string"/>
</connectionStrin gs>

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

0
2100
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 enabled web.config file section replacements for the appSettings element. The replacement is working fine, except, that it is copying the prodAppSettings.config file to the output directory. Is there a way to prevent my prodAppSettings.config file...
4
2178
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
1069
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 name in the root directory with <?xml version="1.0"?> <connectionStrings>
3
942
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 name in the root directory with <?xml version="1.0"?> <connectionStrings>
0
8498
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8840
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8630
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6251
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4237
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4434
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2084
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1831
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.