By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 2,998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Can't read the appSettings section of web.config (Windows Server 2003)

P: n/a
I've searched the web for a solution to this problem. Surprisingly, no
problem/solution has been posted yet.

We can read application configuration information fine when our
asp.net application runs on a Windows 2000 server. But when we run
this same application from Windows 2003, we can't read any application
configuration.

The code in question is this (in default.aspx):

private void Page_Load(object sender, EventArgs e)
{
NameValueCollection sAll = ConfigurationSettings.AppSettings;

foreach (string s in sAll.AllKeys)
{
Response.Write ("Key: " + s + " Value: " + sAll[s] + "<br>");
}

Response.End ();
}

In web.config, we have this:
<appSettings>
<add key="key" value="value"/>
</appSettings>

This code correctly writes the following to the browser on Windows
2000:
Key: key Value: value

On Windows Server 2003 nothing is written.

We configured w3wp.exe (asp.net worker process on Windows 2003) to run
with administrator access, but this didn't fix things. We changed the
ACL of web.config to grant various different AD ids read/write
privileges, but this also didn't solve the problem.

Anybody have any suggestions?

Thanks,
Jared
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
1. change the aspnet_wp BACK to aspnet userid immediately!

2. look in the machine.config file, verify that the appsettings sectiongroup
is defined.

also try removing / reinstalling asp.net on the 2003 server...
--
Eric Newton
eric.at.ensoft-software.com
www.ensoft-software.com
C#/ASP.net Solutions developer

"Jared Hagel" <ja*********@cpr.ca> wrote in message
news:a7**************************@posting.google.c om...
I've searched the web for a solution to this problem. Surprisingly, no
problem/solution has been posted yet.

We can read application configuration information fine when our
asp.net application runs on a Windows 2000 server. But when we run
this same application from Windows 2003, we can't read any application
configuration.

The code in question is this (in default.aspx):

private void Page_Load(object sender, EventArgs e)
{
NameValueCollection sAll = ConfigurationSettings.AppSettings;

foreach (string s in sAll.AllKeys)
{
Response.Write ("Key: " + s + " Value: " + sAll[s] + "<br>");
}

Response.End ();
}

In web.config, we have this:
<appSettings>
<add key="key" value="value"/>
</appSettings>

This code correctly writes the following to the browser on Windows
2000:
Key: key Value: value

On Windows Server 2003 nothing is written.

We configured w3wp.exe (asp.net worker process on Windows 2003) to run
with administrator access, but this didn't fix things. We changed the
ACL of web.config to grant various different AD ids read/write
privileges, but this also didn't solve the problem.

Anybody have any suggestions?

Thanks,
Jared

Nov 19 '05 #2

P: n/a
This problem occurs for me in the simplest scenario.

I wrote a web application with the following code in default.aspx:

private void Page_Load(object sender, System.EventArgs e)
{
Label1.Text = ConfigurationSettings.AppSettings["LabelText"];
}

web.config contains:

<appSettings>
<add key="LabelText" value="test passed"/>
</appSettings>

This label isn't being displayed with the value "test passed" in
Windows Server 2003! Only on Windows 2000.

I'm stumped. Does anybody have any suggestions?

Thanks,
Jared

ja*********@cpr.ca (Jared Hagel) wrote in message news:<a7**************************@posting.google. com>...
I've searched the web for a solution to this problem. Surprisingly, no
problem/solution has been posted yet.

We can read application configuration information fine when our
asp.net application runs on a Windows 2000 server. But when we run
this same application from Windows 2003, we can't read any application
configuration.

The code in question is this (in default.aspx):

private void Page_Load(object sender, EventArgs e)
{
NameValueCollection sAll = ConfigurationSettings.AppSettings;

foreach (string s in sAll.AllKeys)
{
Response.Write ("Key: " + s + " Value: " + sAll[s] + "<br>");
}

Response.End ();
}

In web.config, we have this:
<appSettings>
<add key="key" value="value"/>
</appSettings>

This code correctly writes the following to the browser on Windows
2000:
Key: key Value: value

On Windows Server 2003 nothing is written.

We configured w3wp.exe (asp.net worker process on Windows 2003) to run
with administrator access, but this didn't fix things. We changed the
ACL of web.config to grant various different AD ids read/write
privileges, but this also didn't solve the problem.

Anybody have any suggestions?

Thanks,
Jared

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.