471,071 Members | 4,813 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

apllication wide settings storage

I am needing to read and write application settings from within my ASP.NET
application. My web.config is not an option since I need to be able to write
settings as well. My database is not an option either as the database
location itself is one of the settings.

I've been trying to work with Isolated Storage, but it is obviously designed
to be use specific. I've attempted using Impersonation to load the same
settings for every session, but this doesn't really work. If I impersonate
my user account it works. If I impersonate the Administrator account it
works. But if I create a new user account on the machine and try to
impersonate that account, I just get the following error when trying to get
the isolated storage:

Unable to create the store directory.[The system cannot find the file
specified. ]

I've even made this new account an administrator, but I still get the same
results. Is there a better way to do what I am trying to do? Isn't there
some simple method of saving and retrieving application wide settings in an
ASP.NET environment? I also should mention that it is required that I use
windows authentication for this site. When I turn that off, the IUSR account
works just great for saving and loading settings. But unfortunately I must
authenticate each use in order to use domain security for using Reporting
Services.

Thank you for any suggestions,

-Glenn Thimmes
Nov 18 '05 #1
8 1361
"Glenn Thimmes" <glennthi@nospam_msn.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I am needing to read and write application settings from within my ASP.NET
application. My web.config is not an option since I need to be able to write settings as well. My database is not an option either as the database
location itself is one of the settings.

I've been trying to work with Isolated Storage, but it is obviously designed to be use specific. I've attempted using Impersonation to load the same
settings for every session, but this doesn't really work. If I impersonate
my user account it works. If I impersonate the Administrator account it
works. But if I create a new user account on the machine and try to
impersonate that account, I just get the following error when trying to get the isolated storage:

Unable to create the store directory.[The system cannot find the file
specified. ]

I've even made this new account an administrator, but I still get the same
results. Is there a better way to do what I am trying to do? Isn't there
some simple method of saving and retrieving application wide settings in an ASP.NET environment? I also should mention that it is required that I use
windows authentication for this site. When I turn that off, the IUSR account works just great for saving and loading settings. But unfortunately I must
authenticate each use in order to use domain security for using Reporting
Services.


Store the settings in a database.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
Use application variables.

example:
Global.asax.cs
protected void Application_Start(Object sender, EventArgs e)
{
Application["variable1"] = "abc";
}

WebForm1.aspx.cs
private void Page_Load(object sender, System.EventArgs e)
{
string var = Application["variable1"].ToString();
Application["variable1"] = "123";
}

Bobby Ryzhy
bo***@weekendtech.net
http://www.weekendtech.net

On Thu, 8 Jul 2004 13:56:17 -0600, "Glenn Thimmes"
<glennthi@nospam_msn.com> wrote:
I am needing to read and write application settings from within my ASP.NET
application. My web.config is not an option since I need to be able to write
settings as well. My database is not an option either as the database
location itself is one of the settings.

I've been trying to work with Isolated Storage, but it is obviously designed
to be use specific. I've attempted using Impersonation to load the same
settings for every session, but this doesn't really work. If I impersonate
my user account it works. If I impersonate the Administrator account it
works. But if I create a new user account on the machine and try to
impersonate that account, I just get the following error when trying to get
the isolated storage:

Unable to create the store directory.[The system cannot find the file
specified. ]

I've even made this new account an administrator, but I still get the same
results. Is there a better way to do what I am trying to do? Isn't there
some simple method of saving and retrieving application wide settings in an
ASP.NET environment? I also should mention that it is required that I use
windows authentication for this site. When I turn that off, the IUSR account
works just great for saving and loading settings. But unfortunately I must
authenticate each use in order to use domain security for using Reporting
Services.

Thank you for any suggestions,

-Glenn Thimmes


Nov 18 '05 #3
Thank you for your suggestion. As I mentioned in my post, storing settings
in a database is not possible since part of those settings is the database
server.

"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:et****************@TK2MSFTNGP09.phx.gbl...
"Glenn Thimmes" <glennthi@nospam_msn.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I am needing to read and write application settings from within my ASP.NET application. My web.config is not an option since I need to be able to

write
settings as well. My database is not an option either as the database
location itself is one of the settings.

I've been trying to work with Isolated Storage, but it is obviously

designed
to be use specific. I've attempted using Impersonation to load the same
settings for every session, but this doesn't really work. If I impersonate my user account it works. If I impersonate the Administrator account it
works. But if I create a new user account on the machine and try to
impersonate that account, I just get the following error when trying to

get
the isolated storage:

Unable to create the store directory.[The system cannot find the file
specified. ]

I've even made this new account an administrator, but I still get the same results. Is there a better way to do what I am trying to do? Isn't there
some simple method of saving and retrieving application wide settings in

an
ASP.NET environment? I also should mention that it is required that I use windows authentication for this site. When I turn that off, the IUSR

account
works just great for saving and loading settings. But unfortunately I must authenticate each use in order to use domain security for using Reporting Services.


Store the settings in a database.
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #4
Thanks for the suggestion. Maybe I did not make it clear that these are
settings that need to persist to the hard drive. Each use will need to load
them. Each use will possibly write to them. Since i am using windows
authentication, I need a way that anyone can have permissions to write to
them if they are a member of the right windows group. I have an
administration page that allows admin users to change the database, product
key, and session timeout.

I am surprised that ASP.Net provides such rich capabilities for saving user
settings, but appears to provide nothing for saving application wide
settings.
"Bobby Ryzhy" <br****@hotmail.com> wrote in message
news:bq********************************@4ax.com...
Use application variables.

example:
Global.asax.cs
protected void Application_Start(Object sender, EventArgs e)
{
Application["variable1"] = "abc";
}

WebForm1.aspx.cs
private void Page_Load(object sender, System.EventArgs e)
{
string var = Application["variable1"].ToString();
Application["variable1"] = "123";
}

Bobby Ryzhy
bo***@weekendtech.net
http://www.weekendtech.net

On Thu, 8 Jul 2004 13:56:17 -0600, "Glenn Thimmes"
<glennthi@nospam_msn.com> wrote:
I am needing to read and write application settings from within my ASP.NETapplication. My web.config is not an option since I need to be able to writesettings as well. My database is not an option either as the database
location itself is one of the settings.

I've been trying to work with Isolated Storage, but it is obviously designedto be use specific. I've attempted using Impersonation to load the same
settings for every session, but this doesn't really work. If I impersonatemy user account it works. If I impersonate the Administrator account it
works. But if I create a new user account on the machine and try to
impersonate that account, I just get the following error when trying to getthe isolated storage:

Unable to create the store directory.[The system cannot find the file
specified. ]

I've even made this new account an administrator, but I still get the sameresults. Is there a better way to do what I am trying to do? Isn't there
some simple method of saving and retrieving application wide settings in anASP.NET environment? I also should mention that it is required that I use
windows authentication for this site. When I turn that off, the IUSR accountworks just great for saving and loading settings. But unfortunately I mustauthenticate each use in order to use domain security for using Reporting
Services.

Thank you for any suggestions,

-Glenn Thimmes

Nov 18 '05 #5
You can create your own XML config file that your app loads, modifies,
and maintains - just like the web.config - but you do all the
maintenance.

Bobby Ryzhy
bobby@ domain below
http://www.weekendtech.net

On Thu, 8 Jul 2004 16:05:26 -0600, "Glenn Thimmes"
<glennthi@nospam_msn.com> wrote:
Thanks for the suggestion. Maybe I did not make it clear that these are
settings that need to persist to the hard drive. Each use will need to load
them. Each use will possibly write to them. Since i am using windows
authentication, I need a way that anyone can have permissions to write to
them if they are a member of the right windows group. I have an
administration page that allows admin users to change the database, product
key, and session timeout.

I am surprised that ASP.Net provides such rich capabilities for saving user
settings, but appears to provide nothing for saving application wide
settings.
"Bobby Ryzhy" <br****@hotmail.com> wrote in message
news:bq********************************@4ax.com.. .
Use application variables.

example:
Global.asax.cs
protected void Application_Start(Object sender, EventArgs e)
{
Application["variable1"] = "abc";
}

WebForm1.aspx.cs
private void Page_Load(object sender, System.EventArgs e)
{
string var = Application["variable1"].ToString();
Application["variable1"] = "123";
}

Bobby Ryzhy
bo***@weekendtech.net
http://www.weekendtech.net

On Thu, 8 Jul 2004 13:56:17 -0600, "Glenn Thimmes"
<glennthi@nospam_msn.com> wrote:
>I am needing to read and write application settings from within myASP.NET >application. My web.config is not an option since I need to be able towrite >settings as well. My database is not an option either as the database
>location itself is one of the settings.
>
>I've been trying to work with Isolated Storage, but it is obviouslydesigned >to be use specific. I've attempted using Impersonation to load the same
>settings for every session, but this doesn't really work. If Iimpersonate >my user account it works. If I impersonate the Administrator account it
>works. But if I create a new user account on the machine and try to
>impersonate that account, I just get the following error when trying toget >the isolated storage:
>
>Unable to create the store directory.[The system cannot find the file
>specified. ]
>
>I've even made this new account an administrator, but I still get thesame >results. Is there a better way to do what I am trying to do? Isn't there
>some simple method of saving and retrieving application wide settings inan >ASP.NET environment? I also should mention that it is required that I use
>windows authentication for this site. When I turn that off, the IUSRaccount >works just great for saving and loading settings. But unfortunately Imust >authenticate each use in order to use domain security for using Reporting
>Services.
>
>Thank you for any suggestions,
>
>-Glenn Thimmes
>


Nov 18 '05 #6
That is exactly what I have been trying to do. I have created an XML
settings doc and would like to be able to load it and save it. The problem
is that each session needs to be able to read and write to this file. And
each session can be a different domain account. I do not want to give every
domain account the ability to write to my hard drive. The Isolated Storage
works great if every user needs separate settings, but that is not the case.

Am I missing something? Is there some obvious place where my ASP.Net app
should be able to write and read from the hard disk regardless of who is
logged in, and use the same xml file regardless of who is logged in?

Shouldn't I be able to create a new windows account and impersonate that
account for the duration of my Isolated Storage manipulations? Is there
something wrong with what I did there or is that just the wrong avenue
entirely? I am only able to successfully get the isolated file store when I
impersonate myself. That sounds like a permissions issue, but the
documentation I've read on the Isolated Stored says that it will create a
isolated storage for whatever user context is used and they don't need any
permissions at all for this to work. But for some reason it still will not
work.

Thanks for your help Bobby!

-Glenn

"Bobby Ryzhy" <br****@hotmail.com> wrote in message
news:d5********************************@4ax.com...
You can create your own XML config file that your app loads, modifies,
and maintains - just like the web.config - but you do all the
maintenance.

Bobby Ryzhy
bobby@ domain below
http://www.weekendtech.net

On Thu, 8 Jul 2004 16:05:26 -0600, "Glenn Thimmes"
<glennthi@nospam_msn.com> wrote:
Thanks for the suggestion. Maybe I did not make it clear that these are
settings that need to persist to the hard drive. Each use will need to loadthem. Each use will possibly write to them. Since i am using windows
authentication, I need a way that anyone can have permissions to write to
them if they are a member of the right windows group. I have an
administration page that allows admin users to change the database, productkey, and session timeout.

I am surprised that ASP.Net provides such rich capabilities for saving usersettings, but appears to provide nothing for saving application wide
settings.
"Bobby Ryzhy" <br****@hotmail.com> wrote in message
news:bq********************************@4ax.com.. .
Use application variables.

example:
Global.asax.cs
protected void Application_Start(Object sender, EventArgs e)
{
Application["variable1"] = "abc";
}

WebForm1.aspx.cs
private void Page_Load(object sender, System.EventArgs e)
{
string var = Application["variable1"].ToString();
Application["variable1"] = "123";
}

Bobby Ryzhy
bo***@weekendtech.net
http://www.weekendtech.net

On Thu, 8 Jul 2004 13:56:17 -0600, "Glenn Thimmes"
<glennthi@nospam_msn.com> wrote:

>I am needing to read and write application settings from within my

ASP.NET
>application. My web.config is not an option since I need to be able to

write
>settings as well. My database is not an option either as the database
>location itself is one of the settings.
>
>I've been trying to work with Isolated Storage, but it is obviously

designed
>to be use specific. I've attempted using Impersonation to load the same >settings for every session, but this doesn't really work. If I

impersonate
>my user account it works. If I impersonate the Administrator account it >works. But if I create a new user account on the machine and try to
>impersonate that account, I just get the following error when trying to
get
>the isolated storage:
>
>Unable to create the store directory.[The system cannot find the file
>specified. ]
>
>I've even made this new account an administrator, but I still get the

same
>results. Is there a better way to do what I am trying to do? Isn't
there >some simple method of saving and retrieving application wide settings inan
>ASP.NET environment? I also should mention that it is required that I

use >windows authentication for this site. When I turn that off, the IUSR

account
>works just great for saving and loading settings. But unfortunately I

must
>authenticate each use in order to use domain security for using Reporting >Services.
>
>Thank you for any suggestions,
>
>-Glenn Thimmes
>

Nov 18 '05 #7
"Glenn Thimmes" <glennthi@nospam_msn.com> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl...
Thanks for the suggestion. Maybe I did not make it clear that these are
settings that need to persist to the hard drive. Each use will need to load them. Each use will possibly write to them. Since i am using windows
authentication, I need a way that anyone can have permissions to write to
them if they are a member of the right windows group. I have an
administration page that allows admin users to change the database, product key, and session timeout.

I am surprised that ASP.Net provides such rich capabilities for saving user settings, but appears to provide nothing for saving application wide
settings.


But these are not application-wide settings, they are per-user settings.

ASP.NET 2.0 solves this problem with its Profile APIs.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #8
"But these are not application-wide settings, they are per-user settings."

I'm not sure what you mean. These ARE apllication-wide settings. Otherwise
Isolated Storage would be hunky dory! The same settings for server, serial
number, and session timeout are used by everyone. It is true that these
settings are applied per session, but they are the same settings used by
everyone. When an administrator changes these settings, the changes need to
apply to everyone.

"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"Glenn Thimmes" <glennthi@nospam_msn.com> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl...
Thanks for the suggestion. Maybe I did not make it clear that these are
settings that need to persist to the hard drive. Each use will need to

load
them. Each use will possibly write to them. Since i am using windows
authentication, I need a way that anyone can have permissions to write to them if they are a member of the right windows group. I have an
administration page that allows admin users to change the database,

product
key, and session timeout.

I am surprised that ASP.Net provides such rich capabilities for saving

user
settings, but appears to provide nothing for saving application wide
settings.


But these are not application-wide settings, they are per-user settings.

ASP.NET 2.0 solves this problem with its Profile APIs.
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Yaron Cohen | last post: by
3 posts views Thread by yazan jab | last post: by
reply views Thread by Michael Quinlivan | last post: by
1 post views Thread by Justin Creasy | last post: by
10 posts views Thread by Paul Cheetham | last post: by
17 posts views Thread by =?Utf-8?B?R2Vvcmdl?= | last post: by
reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | 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.