471,316 Members | 1,059 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

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.Configuration 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 ConfigurationSettings object). Any suggestions
are appreciated.
Nov 19 '05 #1
16 1807
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.Configuration 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 ConfigurationSettings 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.Configuration that says explicitly "this method will load an
application's ConfigurationSettings from an XML file".

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings 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.Configuration that says explicitly "this method will load an
application's ConfigurationSettings from an XML file".

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
suggestions
are appreciated.


Nov 19 '05 #4
Sorry, I probably didn't word this properly. ConfigurationSettings is a
Read-Only class, so I can't write to it explicitly by putting this line of
code: ConfigurationSettings.AppSetting("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
ConfigurationSettings.

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
application's ConfigurationSettings from an XML file".

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings 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 ConfigurationSettings
stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.

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

"Timm" wrote:
Sorry, I probably didn't word this properly. ConfigurationSettings is a
Read-Only class, so I can't write to it explicitly by putting this line of
code: ConfigurationSettings.AppSetting("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
ConfigurationSettings.

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
application's ConfigurationSettings from an XML file".

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
>> suggestions
>> are appreciated.
>>
>>
>>


Nov 19 '05 #6
Yes, I am stuck on wanting to use the .Net ConfigurationSettings. 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_darkfalz.com> wrote in message
news:3E**********************************@microsof t.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
ConfigurationSettings
stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.

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

"Timm" wrote:
Sorry, I probably didn't word this properly. ConfigurationSettings is a
Read-Only class, so I can't write to it explicitly by putting this line
of
code: ConfigurationSettings.AppSetting("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
ConfigurationSettings.

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
>> application's ConfigurationSettings from an XML file".
>>
>> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings 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
ConfigurationSettings 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 ConfigurationSettings
from say calling a method with a path to an Web.Config file (something along
the lines of like System.Configuration.LoadConfigurationSettings(XML Path)).

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:8F**********************************@microsof t.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
ConfigurationSettings 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 ConfigurationSettings
from say calling a method with a path to an Web.Config file (something along
the lines of like System.Configuration.LoadConfigurationSettings(XML Path)).

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:8F**********************************@microsof t.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
ConfigurationSettings doesn't give you?

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


Nov 19 '05 #10
Actually... let me rephrase...
It's fixed to "./web.config" and will continue to crawl up to "~/" checking
each folder for another web.config.

The settings are a conglomerate of all the web.config files in the path from
the folder you are in to the root of the VD-Application

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

"Timm" wrote:
Sorry about that. The ability to explicitly load the ConfigurationSettings
from say calling a method with a path to an Web.Config file (something along
the lines of like System.Configuration.LoadConfigurationSettings(XML Path)).

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:8F**********************************@microsof t.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
ConfigurationSettings doesn't give you?

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


Nov 19 '05 #11
Is the "different non-asp program" a .NET application like an EXE or
Windows/Web Service?

If so, how about copying the sections needed from web.config to the
app.config of the client application that consumes these assemblies?..

Also, you may consider keeping the settings for assemblies in a common
config file and all instances of the assembly could refer the same file..

samples here http://weblogs.asp.net/pwilson/archi...4/09/5261.aspx

"Timm" wrote:
Yes, I am stuck on wanting to use the .Net ConfigurationSettings. 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_darkfalz.com> wrote in message
news:3E**********************************@microsof t.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
ConfigurationSettings
stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.

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

"Timm" wrote:
Sorry, I probably didn't word this properly. ConfigurationSettings is a
Read-Only class, so I can't write to it explicitly by putting this line
of
code: ConfigurationSettings.AppSetting("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
ConfigurationSettings.

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
>> application's ConfigurationSettings from an XML file".
>>
>> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
>> >> suggestions
>> >> are appreciated.
>> >>
>> >>
>> >>
>>
>>
>>


Nov 19 '05 #12
Yes, this is a program that is "different non-asp program" category. VB.Net
EXE to be specific.

"Sreejith Ram" <Sr*********@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
Is the "different non-asp program" a .NET application like an EXE or
Windows/Web Service?

If so, how about copying the sections needed from web.config to the
app.config of the client application that consumes these assemblies?..

Also, you may consider keeping the settings for assemblies in a common
config file and all instances of the assembly could refer the same file..

samples here http://weblogs.asp.net/pwilson/archi...4/09/5261.aspx

"Timm" wrote:
Yes, I am stuck on wanting to use the .Net ConfigurationSettings. 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_darkfalz.com> wrote in message
news:3E**********************************@microsof t.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
> ConfigurationSettings
> stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
>
> "Timm" wrote:
>
>> Sorry, I probably didn't word this properly. ConfigurationSettings is
>> a
>> Read-Only class, so I can't write to it explicitly by putting this
>> line
>> of
>> code: ConfigurationSettings.AppSetting("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
>> ConfigurationSettings.
>>
>> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
>> >> application's ConfigurationSettings from an XML file".
>> >>
>> >> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> >> news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
>> >> >> suggestions
>> >> >> are appreciated.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>


Nov 19 '05 #13
According to Curt_C, it seems that Web.config is the ONLY file can be
modified via ASP.net Web Site Administrator Tool or Configuration class.

Was there any class from ASP .net available to read/modify to our own
additional configuration file (as an xml file) for settings our application
purpose?! :(

IS there any?!!!!

--
Best Regards,
Joann
"Sreejith Ram" wrote:
Is the "different non-asp program" a .NET application like an EXE or
Windows/Web Service?

If so, how about copying the sections needed from web.config to the
app.config of the client application that consumes these assemblies?..

Also, you may consider keeping the settings for assemblies in a common
config file and all instances of the assembly could refer the same file..

samples here http://weblogs.asp.net/pwilson/archi...4/09/5261.aspx

"Timm" wrote:
Yes, I am stuck on wanting to use the .Net ConfigurationSettings. 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_darkfalz.com> wrote in message
news:3E**********************************@microsof t.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
ConfigurationSettings
stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.

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

"Timm" wrote:

> Sorry, I probably didn't word this properly. ConfigurationSettings is a
> Read-Only class, so I can't write to it explicitly by putting this line
> of
> code: ConfigurationSettings.AppSetting("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
> ConfigurationSettings.
>
> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
> news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
> >> application's ConfigurationSettings from an XML file".
> >>
> >> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
> >> news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
> >> >> suggestions
> >> >> are appreciated.
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>


Nov 19 '05 #14
Any XML file you want...
What I was trying to get at is that you dont have to use the web.config for
everything. Make a config.xml and a class in the backend called MyConfigs
then you can do whatever you want with it. Put it into a BasePage that you
set all your others to inherit from and POOF, you'd never know the difference
from the web.config (cept maybe that it's not "protected" by IIS).

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

"Joann" wrote:
According to Curt_C, it seems that Web.config is the ONLY file can be
modified via ASP.net Web Site Administrator Tool or Configuration class.

Was there any class from ASP .net available to read/modify to our own
additional configuration file (as an xml file) for settings our application
purpose?! :(

IS there any?!!!!

--
Best Regards,
Joann
"Sreejith Ram" wrote:
Is the "different non-asp program" a .NET application like an EXE or
Windows/Web Service?

If so, how about copying the sections needed from web.config to the
app.config of the client application that consumes these assemblies?..

Also, you may consider keeping the settings for assemblies in a common
config file and all instances of the assembly could refer the same file..

samples here http://weblogs.asp.net/pwilson/archi...4/09/5261.aspx

"Timm" wrote:
Yes, I am stuck on wanting to use the .Net ConfigurationSettings. 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_darkfalz.com> wrote in message
news:3E**********************************@microsof t.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
> ConfigurationSettings
> stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
>
> "Timm" wrote:
>
>> Sorry, I probably didn't word this properly. ConfigurationSettings is a
>> Read-Only class, so I can't write to it explicitly by putting this line
>> of
>> code: ConfigurationSettings.AppSetting("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
>> ConfigurationSettings.
>>
>> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
>> >> application's ConfigurationSettings from an XML file".
>> >>
>> >> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> >> news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
>> >> >> suggestions
>> >> >> are appreciated.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>

Nov 19 '05 #15
This answered my post by the way. Thanks.

"Sreejith Ram" <Sr*********@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
Is the "different non-asp program" a .NET application like an EXE or
Windows/Web Service?

If so, how about copying the sections needed from web.config to the
app.config of the client application that consumes these assemblies?..

Also, you may consider keeping the settings for assemblies in a common
config file and all instances of the assembly could refer the same file..

samples here http://weblogs.asp.net/pwilson/archi...4/09/5261.aspx

"Timm" wrote:
Yes, I am stuck on wanting to use the .Net ConfigurationSettings. 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_darkfalz.com> wrote in message
news:3E**********************************@microsof t.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
> ConfigurationSettings
> stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
>
> "Timm" wrote:
>
>> Sorry, I probably didn't word this properly. ConfigurationSettings is
>> a
>> Read-Only class, so I can't write to it explicitly by putting this
>> line
>> of
>> code: ConfigurationSettings.AppSetting("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
>> ConfigurationSettings.
>>
>> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
>> >> application's ConfigurationSettings from an XML file".
>> >>
>> >> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> >> news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
>> >> >> suggestions
>> >> >> are appreciated.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>


Nov 19 '05 #16
Joann,

If you copy the config info from web.config file to the APP.CONFIG of the
client application that consumes the assemblies or a common config file, the
System.Configuaron class would read it just like web.config ..

More about App.config file
http://msdn.microsoft.com/library/de...ationfiles.asp

More about reading common config file
http://weblogs.asp.net/pwilson/archi...4/09/5261.aspx

If you are looking to add CUSTOM TAGS to web.config , this may help
http://www.devhood.com/tutorials/tut...tutorial_id=90
Looks like TIM could figure it out with app.config any ways

"Joann" wrote:
According to Curt_C, it seems that Web.config is the ONLY file can be
modified via ASP.net Web Site Administrator Tool or Configuration class.

Was there any class from ASP .net available to read/modify to our own
additional configuration file (as an xml file) for settings our application
purpose?! :(

IS there any?!!!!

--
Best Regards,
Joann
"Sreejith Ram" wrote:
Is the "different non-asp program" a .NET application like an EXE or
Windows/Web Service?

If so, how about copying the sections needed from web.config to the
app.config of the client application that consumes these assemblies?..

Also, you may consider keeping the settings for assemblies in a common
config file and all instances of the assembly could refer the same file..

samples here http://weblogs.asp.net/pwilson/archi...4/09/5261.aspx

"Timm" wrote:
Yes, I am stuck on wanting to use the .Net ConfigurationSettings. 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_darkfalz.com> wrote in message
news:3E**********************************@microsof t.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
> ConfigurationSettings
> stuff, dont. Just write your own.. MySite.MySiteSettings or whatever.
>
> --
> Curt Christianson
> site: http://www.darkfalz.com
> blog: http://blog.darkfalz.com
>
>
>
> "Timm" wrote:
>
>> Sorry, I probably didn't word this properly. ConfigurationSettings is a
>> Read-Only class, so I can't write to it explicitly by putting this line
>> of
>> code: ConfigurationSettings.AppSetting("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
>> ConfigurationSettings.
>>
>> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> news:3A**********************************@microsof t.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.Configuration that says explicitly "this method will load an
>> >> application's ConfigurationSettings from an XML file".
>> >>
>> >> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
>> >> news:93**********************************@microsof t.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.Configuration 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 ConfigurationSettings object). Any
>> >> >> suggestions
>> >> >> are appreciated.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>

Nov 19 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Simon Harvey | last post: by
10 posts views Thread by mike | last post: by
3 posts views Thread by Jeff Robichaud | last post: by
2 posts views Thread by 3471Jack329 | last post: by
reply views Thread by rosydwin | last post: by

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.