473,749 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Web.config file outside of ASP

I'm trying to use ASP objects (basically formed and populated based on
Web.Config settings) and I want to use them in a different non-asp program
with minimal reprogramming. So, my question is how do I mock up what ASP
does to read the Web.Config file? I've tried messing around in the
System.Configur ation library and haven't been able to find anything from
taking a quick look at the objects and their methods (for the goal of
populating the application's ConfigurationSe ttings object). Any suggestions
are appreciated.
Nov 19 '05 #1
16 1993
It's just an XML file.
Does whatever you are trying to write in have the ability to read them? It's
just a class with properties that pull from the XML

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
I'm trying to use ASP objects (basically formed and populated based on
Web.Config settings) and I want to use them in a different non-asp program
with minimal reprogramming. So, my question is how do I mock up what ASP
does to read the Web.Config file? I've tried messing around in the
System.Configur ation library and haven't been able to find anything from
taking a quick look at the objects and their methods (for the goal of
populating the application's ConfigurationSe ttings object). Any suggestions
are appreciated.

Nov 19 '05 #2
The class I'm trying to write to is a read only class with 2 methods for
getting settings out of it. I haven't found any methods within the
System.Configur ation that says explicitly "this method will load an
application's ConfigurationSe ttings from an XML file".

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:93******** *************** ***********@mic rosoft.com...
It's just an XML file.
Does whatever you are trying to write in have the ability to read them?
It's
just a class with properties that pull from the XML

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
I'm trying to use ASP objects (basically formed and populated based on
Web.Config settings) and I want to use them in a different non-asp
program
with minimal reprogramming. So, my question is how do I mock up what ASP
does to read the Web.Config file? I've tried messing around in the
System.Configur ation library and haven't been able to find anything from
taking a quick look at the objects and their methods (for the goal of
populating the application's ConfigurationSe ttings object). Any
suggestions
are appreciated.

Nov 19 '05 #3
Write it....
It's just an XML reader parsing the nodes into properties

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
The class I'm trying to write to is a read only class with 2 methods for
getting settings out of it. I haven't found any methods within the
System.Configur ation that says explicitly "this method will load an
application's ConfigurationSe ttings from an XML file".

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:93******** *************** ***********@mic rosoft.com...
It's just an XML file.
Does whatever you are trying to write in have the ability to read them?
It's
just a class with properties that pull from the XML

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
I'm trying to use ASP objects (basically formed and populated based on
Web.Config settings) and I want to use them in a different non-asp
program
with minimal reprogramming. So, my question is how do I mock up what ASP
does to read the Web.Config file? I've tried messing around in the
System.Configur ation library and haven't been able to find anything from
taking a quick look at the objects and their methods (for the goal of
populating the application's ConfigurationSe ttings object). Any
suggestions
are appreciated.


Nov 19 '05 #4
Sorry, I probably didn't word this properly. ConfigurationSe ttings is a
Read-Only class, so I can't write to it explicitly by putting this line of
code: ConfigurationSe ttings.AppSetti ng("SomeSetting ") = "Foo Value". It will
error out if i do that.

So what I need is some explanation on how ASP populates this class, because
there has to be a method that has access to write properties to the
ConfigurationSe ttings.

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:3A******** *************** ***********@mic rosoft.com...
Write it....
It's just an XML reader parsing the nodes into properties

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
The class I'm trying to write to is a read only class with 2 methods for
getting settings out of it. I haven't found any methods within the
System.Configur ation that says explicitly "this method will load an
application's ConfigurationSe ttings from an XML file".

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:93******** *************** ***********@mic rosoft.com...
> It's just an XML file.
> Does whatever you are trying to write in have the ability to read them?
> It's
> just a class with properties that pull from the XML
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
>
> "Timm" wrote:
>
>> I'm trying to use ASP objects (basically formed and populated based on
>> Web.Config settings) and I want to use them in a different non-asp
>> program
>> with minimal reprogramming. So, my question is how do I mock up what
>> ASP
>> does to read the Web.Config file? I've tried messing around in the
>> System.Configur ation library and haven't been able to find anything
>> from
>> taking a quick look at the objects and their methods (for the goal of
>> populating the application's ConfigurationSe ttings object). Any
>> suggestions
>> are appreciated.
>>
>>
>>


Nov 19 '05 #5
What I'm saying is DONT use the built in. Simply write a class that has an
XML reader in it and manually parse the .config file (it's just a fancy XML
file). You can make the individual nodes into Properties in your class, and
even make them read-only if you want.

You seem to be stuck on wanting to try to use the .net ConfigurationSe ttings
stuff, dont. Just write your own.. MySite.MySiteSe ttings or whatever.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
Sorry, I probably didn't word this properly. ConfigurationSe ttings is a
Read-Only class, so I can't write to it explicitly by putting this line of
code: ConfigurationSe ttings.AppSetti ng("SomeSetting ") = "Foo Value". It will
error out if i do that.

So what I need is some explanation on how ASP populates this class, because
there has to be a method that has access to write properties to the
ConfigurationSe ttings.

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:3A******** *************** ***********@mic rosoft.com...
Write it....
It's just an XML reader parsing the nodes into properties

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
The class I'm trying to write to is a read only class with 2 methods for
getting settings out of it. I haven't found any methods within the
System.Configur ation that says explicitly "this method will load an
application's ConfigurationSe ttings from an XML file".

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:93******** *************** ***********@mic rosoft.com...
> It's just an XML file.
> Does whatever you are trying to write in have the ability to read them?
> It's
> just a class with properties that pull from the XML
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
>
> "Timm" wrote:
>
>> I'm trying to use ASP objects (basically formed and populated based on
>> Web.Config settings) and I want to use them in a different non-asp
>> program
>> with minimal reprogramming. So, my question is how do I mock up what
>> ASP
>> does to read the Web.Config file? I've tried messing around in the
>> System.Configur ation library and haven't been able to find anything
>> from
>> taking a quick look at the objects and their methods (for the goal of
>> populating the application's ConfigurationSe ttings object). Any
>> suggestions
>> are appreciated.
>>
>>
>>


Nov 19 '05 #6
Yes, I am stuck on wanting to use the .Net ConfigurationSe ttings. It's the
curse of the sutsourced software we bought for a quick solution. I could do
you said and manually parse out the XML file, but thing is I would then have
to recode serveral different classes to accomodate to this (and then for
future changes in the object we would have to maintain two sets of objects).
It may end up that I have to do this, but I just need to find out if there's
a quick way to just get the settings in just like ASP does. If there are any
good books that talk about the ASP framework and the really in depth
workings (as far as extending base classes and whatnot) of it I could
probably take those as suggestions as well.

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:3E******** *************** ***********@mic rosoft.com...
What I'm saying is DONT use the built in. Simply write a class that has an
XML reader in it and manually parse the .config file (it's just a fancy
XML
file). You can make the individual nodes into Properties in your class,
and
even make them read-only if you want.

You seem to be stuck on wanting to try to use the .net
ConfigurationSe ttings
stuff, dont. Just write your own.. MySite.MySiteSe ttings or whatever.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
Sorry, I probably didn't word this properly. ConfigurationSe ttings is a
Read-Only class, so I can't write to it explicitly by putting this line
of
code: ConfigurationSe ttings.AppSetti ng("SomeSetting ") = "Foo Value". It
will
error out if i do that.

So what I need is some explanation on how ASP populates this class,
because
there has to be a method that has access to write properties to the
ConfigurationSe ttings.

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:3A******** *************** ***********@mic rosoft.com...
> Write it....
> It's just an XML reader parsing the nodes into properties
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
>
> "Timm" wrote:
>
>> The class I'm trying to write to is a read only class with 2 methods
>> for
>> getting settings out of it. I haven't found any methods within the
>> System.Configur ation that says explicitly "this method will load an
>> application's ConfigurationSe ttings from an XML file".
>>
>> "Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
>> news:93******** *************** ***********@mic rosoft.com...
>> > It's just an XML file.
>> > Does whatever you are trying to write in have the ability to read
>> > them?
>> > It's
>> > just a class with properties that pull from the XML
>> >
>> > --
>> > Curt Christianson
>> > site: http://www.darkfalz.com
>> > blog: http://blog.darkfalz.com
>> >
>> >
>> >
>> > "Timm" wrote:
>> >
>> >> I'm trying to use ASP objects (basically formed and populated based
>> >> on
>> >> Web.Config settings) and I want to use them in a different non-asp
>> >> program
>> >> with minimal reprogramming. So, my question is how do I mock up
>> >> what
>> >> ASP
>> >> does to read the Web.Config file? I've tried messing around in the
>> >> System.Configur ation library and haven't been able to find anything
>> >> from
>> >> taking a quick look at the objects and their methods (for the goal
>> >> of
>> >> populating the application's ConfigurationSe ttings object). Any
>> >> suggestions
>> >> are appreciated.
>> >>
>> >>
>> >>
>>
>>
>>


Nov 19 '05 #7
Ahhh... you never indicated you HAD to use the existing class...

Let me start over. What is the exact functionality you need that the
ConfigurationSe ttings doesn't give you?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #8
Sorry about that. The ability to explicitly load the ConfigurationSe ttings
from say calling a method with a path to an Web.Config file (something along
the lines of like System.Configur ation.LoadConfi gurationSetting s(XMLPath)).

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:8F******** *************** ***********@mic rosoft.com...
Ahhh... you never indicated you HAD to use the existing class...

Let me start over. What is the exact functionality you need that the
ConfigurationSe ttings doesn't give you?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #9
Ahh..
Nope!
That class is fixed to "~/web.config"

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Timm" wrote:
Sorry about that. The ability to explicitly load the ConfigurationSe ttings
from say calling a method with a path to an Web.Config file (something along
the lines of like System.Configur ation.LoadConfi gurationSetting s(XMLPath)).

"Curt_C [MVP]" <software_at_da rkfalz.com> wrote in message
news:8F******** *************** ***********@mic rosoft.com...
Ahhh... you never indicated you HAD to use the existing class...

Let me start over. What is the exact functionality you need that the
ConfigurationSe ttings doesn't give you?

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com


Nov 19 '05 #10

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

Similar topics

3
3455
by: Simon Harvey | last post by:
Hi chaps, Can someone direct me to the necessary class that will allow me to write information into my applications .config file? I know how to read information but I'm sure there must be a way to write out to the config file easily as well. Also, my application doesnt actually have a config file created by default. I thought the VS template would create one automatically but it doesnt. Is it ok just to make one in the form:
2
1651
by: MisConFit8 | last post by:
My question is this - is it possible to set a standard value in the web.config file and change it later based on conditions? Why, you might ask? I am building a web based application for inter-office usage. It is an application where software product keys and license keys are stored and created. We have 1/2 of the office personnel working from within the domain, and 1/2 that disconnect and work in the field. I am setting up replication for...
10
2204
by: mike | last post by:
Is it possible to move the web.config out of the application folder? I would like it off somewhere out of the web directory
3
2487
by: Jeff Robichaud | last post by:
Hello, Since it is possible to put application settings in a file other than web.config, I was wondering what is the best practice in doing so vs. putting these settings directly in web.config. My point is that when I deploy an application, I want to overwrite web.config all the time, because the contents of this file has a direct impact on the application's overall behavior. For example, the execution timeout for my app is 60 seconds,...
6
1599
by: David++ | last post by:
Hi folks, So I have implemented a Web service which provides several Web Methods. Before the client can use the WebMethods they must first be authenticated and authorized i.e. they login, obtain a string 'ticket' and then must use this ticket to make subsequent calls to the Web Methods. Users are validated by checking to see if they exist in the web.config file which looks like this -
2
11432
by: rcp | last post by:
Hi all, I've read all posts from all existing threads and none of them worked to solve my problem, although its exactly the same. I'll try to explain my case and see if a kind soul could help me out: I've a win32 service in C# on a client machine A, which accesses a WS (C#) on a server machine B (hosted on an IIS) Case 1: If I try to add the WSDL for the WS through VS2005, the 'Discovery
2
1575
by: 3471Jack329 | last post by:
This is a stupid question but I risk it. Just in case something is possible... How can I modify the web.config settings from ASP.NET programming? <system.net> <mailSettings> <smtp from="email@address.ca"> <network host="link.geogio.com" password="password"
0
1597
by: BrianKer | last post by:
Hi! It's my first discussion on this forum. First I have a exe like this below (the object can invoke by console) public class DynamicLoad { public Type AssemblyType = null; public Assembly TestAssembly1 = null; public DynamicLoad () { string load_path = "..\OuterAssembly1\OuterAssembly1.dll"; TestAssembly1 = Assembly.LoadFrom(load_path);
12
13437
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD file was built by draging tables from the Data Sources pane. Auto-generated code created the files associated wtih the XSD file (xss,
0
8996
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
8832
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
9388
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...
0
9254
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
8256
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...
0
6078
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
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
3
2217
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.