473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 1461
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Galina | last post by:
Hello I am trying to create a table, which includes a field type LONG. The wizard hasn't allowed me to enter storage settings for this table. It set the initial size is 64K and not available to...
2
by: Yaron Cohen | last post by:
Hi, I would like to ask for your help. I am using IE5.5. I have a wide page with horizontal scroll bar. The problem is that I get only 1 page when printing it using "file->print" or...
3
by: yazan jab | last post by:
Is it true that Multibyte characters are : char arrays (witch represent a string from the basic characters set). In this case Wide characters are the way for encoding characters from the...
0
by: Michael Quinlivan | last post by:
Hi, I am writing an app in VB.NET In short, I need to be able to have a single application configuration file that applies to ALL users of the application, and that can be modified by ANY user....
1
by: Justin Creasy | last post by:
Hello, I am trying to add the ability to save my applications settings for each user. I was just wondering what the best method is to do this. The only requirement is that any user account (user,...
10
by: Paul Cheetham | last post by:
Hi, I am developing an application that needs to store some machine-specific settings. The application is going to be published on the network in order to keep the clients on the latest version....
4
by: Richard Lewis Haggard | last post by:
I have an application that can't use the registry to save various user options and application settings. My first thought was to simply use an application configuration file but this approach seems...
17
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi misters, i have application winforms in VB.NET When I press F5, for executing Debug....it's slows... I see,
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.