473,785 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1307
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:

<connectionStri ngs>
<clear />
<add name="Northwind SQL"
connectionStrin g="Data Source=(local); Initial
Catalog=Northwi nd;Integrated Security=true;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

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

<connectionStri ngs configSource="c onnections.conf ig"/>

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*****@thisis junk.com> wrote in message news:O0******** ******@TK2MSFTN GP14.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.co nfig" 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:

<connectionStri ngs>
<clear />
<add name="Northwind SQL"
connectionStrin g="Data Source=(local); Initial
Catalog=Northwi nd;Integrated Security=true;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

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

<connectionStri ngs configSource="c onnections.conf ig"/>

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*****@thisis junk.com> wrote in message news:O0******** ******@TK2MSFTN GP14.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.co nfig" 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*****@thisis junk.com> wrote in message news:ee******** ******@TK2MSFTN GP14.phx.gbl... Juan,

Thanks for the answer. I was wondering that if i change contents of the "connections.co nfig" 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:

<connectionStri ngs>
<clear />
<add name="Northwind SQL"
connectionStrin g="Data Source=(local); Initial
Catalog=Northwi nd;Integrated Security=true;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>

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

<connectionStri ngs configSource="c onnections.conf ig"/>

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*****@thisis junk.com> wrote in message news:O0******** ******@TK2MSFTN GP14.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*****@thisis junk.com>
wrote:
I was wondering that if i change contents of the
"connections.c onfig" file , would ASP.Net recognize it and reload the
application automatically ?


You should be able to do this with the restartOnExtern alChanges
property for the configuration section. If you look in web.config,
appSettings will not restart for external changes, but
connectionStrin gs 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
2906
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 file). This schema is not used at run-time. What we do is use XPath expressions to query for required information (nodes). We are currently still in development, but we have a few deployments to test the software. These deployments each have...
5
2279
by: rdcpro | last post by:
In reading MSDN docs on creating custom Configuration sections, I found this page: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfcustomelementfornamevaluesectionhandlerdictionarysectionhandler.asp At the very bottom, it says: Configuration File This element can be used in the application configuration file, machine configuration file (Machine.config), and Web.config files that are not at the
5
2585
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 solution: 1) web service website. 2) SOAP Extension Class Lib that compiles to a dll 3) WinForm application with a proxy to test the web service.
5
1250
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 the form of ini files. I am trying to learn new techniques (OOP etc..) and trying to make my app as modern as possible. Are XML files the preferred method of doing this? Whatever the correct way of handling configuration files is, can someone...
6
1450
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 file. How can i choose in the .bat file which configuration file to use ? (something like myApp.exe -D file1.config). Thanks.
0
2509
by: metaperl | last post by:
A Comparison of Python Class Objects and Init Files for Program Configuration ============================================================================= Terrence Brannon bauhaus@metaperl.com http://www.livingcosmos.org/Members/sundevil/python/articles/a-comparison-of-python-class-objects-and-init-files-for-program-configuration/view
9
2288
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 of view, ini-files are more comfortable to read and edit) Where should I store user specific config data? Where should I store machine specific config data?
7
10323
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 called AssemblySettings that someone (I forget his name) had written. When the class library was finished, you deployed it to the GAC and put the configuration files in the GAC with the class library assembly. This no longer works. In fact...
4
57115
by: aSoundMind | last post by:
Hi there, I recieve this error Server Error in '/integrate' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
1
3826
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 configuration files in the <root-dir> of the application. I am specifying the path for WebAgent.conf as “/WebAgent.conf” in my AuthenticateUser java class and in WebAgent.conf, the reference to SmHost.conf is given as “/SmHost.conf”. I am copying...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10152
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
10092
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
7500
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
6740
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
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.