473,406 Members | 2,633 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.

Web.config not being read.

I'm having a problem deploying my ASP.NET application to a WIN2k server.
(IIS5 .NET 1.1)

When I try to access ConfigurationSettings.AppSettings("WhateverValue") I
get an "Object reference not set to an instance of an object." message

I thought this may have been to do with Virtual Directory settings but I've
got the folder set as an application in IIS and asp.net is installed and
working. My web.config file is Not Marked read-only and I can't see any
other problems with the setup. pages that do not attempt to read settings
from the web.config work correctly.

Has anyone else come across this problem, and if so, how did you fix it?

best regards,

Chris.

Nov 18 '05 #1
4 2975
Have you put your <appSettings></appSettings> outside of the <system.web>

<configuration>

<appSettings>
<add key="WhateverValue" value="1234" />
</appSettings>

<system.web>
...
</system.web>
</configuration>

Also web.config is case sensitive, but I don't think that matters as far as
attribute values.

HTH,
--Michael

"Chris V" <va***********@gaelREMOVETHISquality.co.uk> wrote in message
news:40******@news.star.co.uk...
I'm having a problem deploying my ASP.NET application to a WIN2k server.
(IIS5 .NET 1.1)

When I try to access ConfigurationSettings.AppSettings("WhateverValue") I
get an "Object reference not set to an instance of an object." message

I thought this may have been to do with Virtual Directory settings but I've got the folder set as an application in IIS and asp.net is installed and
working. My web.config file is Not Marked read-only and I can't see any
other problems with the setup. pages that do not attempt to read settings
from the web.config work correctly.

Has anyone else come across this problem, and if so, how did you fix it?

best regards,

Chris.

Nov 18 '05 #2
Hi Michael,

Yes. My web.config file is configured correctly.

It's one of these horrible situations my app works on a different machine
that appears to be configured identicaly. The differences may be a result of
the fact that I have Visual Studio installed on my development machine but
not on the server I'm deploying to.

cheers,

Chris.
"Michael" <raterus@localhost> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Have you put your <appSettings></appSettings> outside of the <system.web>

<configuration>

<appSettings>
<add key="WhateverValue" value="1234" />
</appSettings>

<system.web>
...
</system.web>
</configuration>

Also web.config is case sensitive, but I don't think that matters as far as attribute values.

HTH,
--Michael

"Chris V" <va***********@gaelREMOVETHISquality.co.uk> wrote in message
news:40******@news.star.co.uk...
I'm having a problem deploying my ASP.NET application to a WIN2k server.
(IIS5 .NET 1.1)

When I try to access ConfigurationSettings.AppSettings("WhateverValue") I get an "Object reference not set to an instance of an object." message

I thought this may have been to do with Virtual Directory settings but

I've
got the folder set as an application in IIS and asp.net is installed and
working. My web.config file is Not Marked read-only and I can't see any
other problems with the setup. pages that do not attempt to read settings from the web.config work correctly.

Has anyone else come across this problem, and if so, how did you fix it?

best regards,

Chris.


Nov 18 '05 #3
Not sure. Do you have a single web.config file on the whole site ? Perhaps
another one could be read instead ? If you change some other setting in this
file is it taken into account ?

--

"Chris V" <va***********@gaelREMOVETHISquality.co.uk> a écrit dans le
message de news:40******@news.star.co.uk...
Hi Michael,

Yes. My web.config file is configured correctly.

It's one of these horrible situations my app works on a different machine
that appears to be configured identicaly. The differences may be a result of the fact that I have Visual Studio installed on my development machine but
not on the server I'm deploying to.

cheers,

Chris.
"Michael" <raterus@localhost> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Have you put your <appSettings></appSettings> outside of the <system.web>

<configuration>

<appSettings>
<add key="WhateverValue" value="1234" />
</appSettings>

<system.web>
...
</system.web>
</configuration>

Also web.config is case sensitive, but I don't think that matters as far as
attribute values.

HTH,
--Michael

"Chris V" <va***********@gaelREMOVETHISquality.co.uk> wrote in message
news:40******@news.star.co.uk...
I'm having a problem deploying my ASP.NET application to a WIN2k server. (IIS5 .NET 1.1)

When I try to access ConfigurationSettings.AppSettings("WhateverValue") I get an "Object reference not set to an instance of an object." message

I thought this may have been to do with Virtual Directory settings but

I've
got the folder set as an application in IIS and asp.net is installed
and working. My web.config file is Not Marked read-only and I can't see any other problems with the setup. pages that do not attempt to read

settings from the web.config work correctly.

Has anyone else come across this problem, and if so, how did you fix it?
best regards,

Chris.




Nov 18 '05 #4
> When I try to access ConfigurationSettings.AppSettings("WhateverValue") I
get an "Object reference not set to an instance of an object." message

It's one of these horrible situations my app works on a different machine
that appears to be configured identicaly. The differences may be a result of the fact that I have Visual Studio installed on my development machine but
not on the server I'm deploying to.


Compare your machine.config files for the different machines. They should
both have these sections:

<configuration>
<configSections>
<section name="appSettings"
type="System.Configuration.NameValueFileSectionHan dler, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</configSections>
</configuration>

If one of them doesn't or they differ, try fixing it for the machine that is
giving you trouble.

Martin.
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Maxim Khesin | last post by:
I want to have a config file with my python proggie, satisfying the following requirements: 1) support key->(value, default) 2) simple and intuitive to read and edit 3) easyly readable into a...
4
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply*...
16
by: DraguVaso | last post by:
Hi, I have a Windows Service running (made in VB.NET), and wanted to be able to change from time to time some parameters by changing them in the App.config. But it seems that the application...
3
by: Mustaq | last post by:
Hi, How to read same config file from different application? I have 4 application in VB.NET, all are using different app.config files. NOW I need all to read only one config file, how can I do...
16
by: Timm | last post by:
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...
5
by: Sridhar | last post by:
Hi, I have created a project which contains classes to read the data from the database. This project has an App.Config file which contains the SqlConnection String. when this code is called from...
3
by: Richard Lewis Haggard | last post by:
I have a test application that is calling an assembly that reads some strings out of a config file. Normally, this assembly supports a web application and the information can be read just fine....
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
5
by: alf | last post by:
Hi folks, I'm trying to read a web.config section using RoleManagerSection settings = (RoleManagerSection)System.Configuration.ConfigurationManager.GetSection("system.web/roleManager"); and I...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.