473,991 Members | 2,512 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 1644
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
2115
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
2186
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
1076
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
959
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
11493
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
11722
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,...
0
10994
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8550
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
6504
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
6665
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4829
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3840
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.