473,394 Members | 1,697 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,394 software developers and data experts.

ASP.Net 2.0 Configuration files.

Iam using a couple of external (other than web.config) configuration
files for my project , and i want their behavior to be like that of
web.config file ( the application should track changes and reload if
required),

is this possible in the new ASP.Net 2.0 ?

thanks
Dec 12 '05 #1
4 1291
We have an answer to this from a MSFT authorized source.

---000---

One way to handle it is to use configuration file fragments and point
to them in your web config file. Your fragment would look like this,
without the namespace:

<connectionStrings>
<clear />
<add name="NorthwindSQL"
connectionString="Data Source=(local);Initial
Catalog=Northwind;Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>

Your Web config would have this line, which uses the fragment:

<connectionStrings configSource="connections.config"/>

One significant advantage of using config file fragments for ASP.NET
apps is that config file fragments can be edited at runtime without
causing an application restart.

---000---

You can modify that example for different configuration sections.


Juan T. Llibre
ASP.NET MVP
============
"Ashish" <as*****@thisisjunk.com> wrote in message news:O0**************@TK2MSFTNGP14.phx.gbl...
Iam using a couple of external (other than web.config) configuration files for my project , and i
want their behavior to be like that of web.config file ( the application should track changes and
reload if required),

is this possible in the new ASP.Net 2.0 ?

thanks

Dec 12 '05 #2
Juan,

Thanks for the answer. I was wondering that if i change contents of the
"connections.config" file , would ASP.Net recognize it and reload the
application automatically ?

Juan T. Llibre wrote:
We have an answer to this from a MSFT authorized source.

---000---

One way to handle it is to use configuration file fragments and point
to them in your web config file. Your fragment would look like this,
without the namespace:

<connectionStrings>
<clear />
<add name="NorthwindSQL"
connectionString="Data Source=(local);Initial
Catalog=Northwind;Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>

Your Web config would have this line, which uses the fragment:

<connectionStrings configSource="connections.config"/>

One significant advantage of using config file fragments for ASP.NET
apps is that config file fragments can be edited at runtime without
causing an application restart.

---000---

You can modify that example for different configuration sections.


Juan T. Llibre
ASP.NET MVP
============
"Ashish" <as*****@thisisjunk.com> wrote in message news:O0**************@TK2MSFTNGP14.phx.gbl...
Iam using a couple of external (other than web.config) configuration files for my project , and i
want their behavior to be like that of web.config file ( the application should track changes and
reload if required),

is this possible in the new ASP.Net 2.0 ?

thanks


Dec 12 '05 #3
re:
Thanks for the answer. I was wondering that if i change contents of the "connections.config" file
, would ASP.Net recognize it and reload the application automatically ?
That's what this part of the answer explains : One significant advantage of using config file fragments for ASP.NET
apps is that config file fragments can be edited at runtime without
causing an application restart.
You don't need to reload the application.

ASP.NET will recognize runtime changes to
config file fragments without needing an application reload/restart.

Juan T. Llibre
ASP.NET MVP
============
"Ashish" <as*****@thisisjunk.com> wrote in message news:ee**************@TK2MSFTNGP14.phx.gbl... Juan,

Thanks for the answer. I was wondering that if i change contents of the "connections.config" file
, would ASP.Net recognize it and reload the application automatically ?

Juan T. Llibre wrote:
We have an answer to this from a MSFT authorized source.

---000---

One way to handle it is to use configuration file fragments and point
to them in your web config file. Your fragment would look like this,
without the namespace:

<connectionStrings>
<clear />
<add name="NorthwindSQL"
connectionString="Data Source=(local);Initial
Catalog=Northwind;Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>

Your Web config would have this line, which uses the fragment:

<connectionStrings configSource="connections.config"/>

One significant advantage of using config file fragments for ASP.NET
apps is that config file fragments can be edited at runtime without
causing an application restart.

---000---

You can modify that example for different configuration sections.


Juan T. Llibre
ASP.NET MVP
============
"Ashish" <as*****@thisisjunk.com> wrote in message news:O0**************@TK2MSFTNGP14.phx.gbl...
Iam using a couple of external (other than web.config) configuration files for my project , and i
want their behavior to be like that of web.config file ( the application should track changes and
reload if required),

is this possible in the new ASP.Net 2.0 ?

thanks



Dec 12 '05 #4
On Mon, 12 Dec 2005 12:34:14 -0600, Ashish <as*****@thisisjunk.com>
wrote:
I was wondering that if i change contents of the
"connections.config" file , would ASP.Net recognize it and reload the
application automatically ?


You should be able to do this with the restartOnExternalChanges
property for the configuration section. If you look in web.config,
appSettings will not restart for external changes, but
connectionStrings will. You could always moidfy these default
settings, of course.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Dec 12 '05 #5

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

Similar topics

1
by: TT (Tom Tempelaere) | last post by:
Hey everyone, I'm currently writing software for a project that uses a lot of Xml files for configuration. The project is written in C#/.NET. Each such xml file has a schema defined for it (Xsd...
5
by: rdcpro | last post by:
In reading MSDN docs on creating custom Configuration sections, I found this page: ...
5
by: NoNickname | last post by:
Basically, how do I know that the release versions of all components are being published? The Build | Configuration Manager is confusing me a little in VS2005. I have three projects in my...
5
by: Ivan Weiss | last post by:
Hey all, I am trying to add a configuration file to my app so that I can store configuration options and provide a form to allow the user to change them. I know that these used to always be in...
6
by: yaron | last post by:
Hi all, I want to give a sample console application for the user with 2 configuration files. I want to give also a 2 .bat files for running the sample application, one for each configuration...
0
by: metaperl | last post by:
A Comparison of Python Class Objects and Init Files for Program Configuration ============================================================================= Terrence Brannon bauhaus@metaperl.com...
9
by: KarlM | last post by:
After reading some articles regarding confuguration data I'm a bit confused. Where is the right place for storing configuration data? - XML-files? - registry? - INI-files? (from a users point...
7
by: Peter Bradley | last post by:
OK. A bit behind the times, I know; but we're just moving over to .NET 2.0. How on earth do you manage configuration settings in a class library in .NET 2.0? In version 1.1, we used a handy class...
4
by: aSoundMind | last post by:
Hi there, I recieve this error Server Error in '/integrate' Application. -------------------------------------------------------------------------------- Configuration Error Description: An...
1
by: ajmerasunny | last post by:
Hi All, I have a java web application in which I need to read a configuration file(WebAgent.conf) that has the reference of another configuration file(SmHost.conf). I am placing both these...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.