apllication wide settings storage

G

Glenn Thimmes

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
 
J

John Saunders

Glenn Thimmes said:
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.
 
B

Bobby Ryzhy

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
(e-mail address removed)
http://www.weekendtech.net
 
G

Glenn Thimmes

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 said:
Glenn Thimmes said:
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.
 
G

Glenn Thimmes

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 said:
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
(e-mail address removed)
http://www.weekendtech.net

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
 
B

Bobby Ryzhy

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

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 said:
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
(e-mail address removed)
http://www.weekendtech.net

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
 
G

Glenn Thimmes

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

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 said:
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
(e-mail address removed)
http://www.weekendtech.net

On Thu, 8 Jul 2004 13:56:17 -0600, "Glenn Thimmes"

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
 
J

John Saunders

Glenn Thimmes said:
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.
 
G

Glenn Thimmes

"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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top