473,625 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ConfigurationSe ttings.AppSetti ngs("WhateverVa lue") 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 2992
Have you put your <appSettings> </appSettings> outside of the <system.web>

<configuratio n>

<appSettings>
<add key="WhateverVa lue" 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***********@ gaelREMOVETHISq uality.co.uk> wrote in message
news:40******@n ews.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 ConfigurationSe ttings.AppSetti ngs("WhateverVa lue") 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@localh ost> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Have you put your <appSettings> </appSettings> outside of the <system.web>

<configuratio n>

<appSettings>
<add key="WhateverVa lue" 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***********@ gaelREMOVETHISq uality.co.uk> wrote in message
news:40******@n ews.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 ConfigurationSe ttings.AppSetti ngs("WhateverVa lue") 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***********@ gaelREMOVETHISq uality.co.uk> a écrit dans le
message de news:40******@n ews.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@localh ost> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Have you put your <appSettings> </appSettings> outside of the <system.web>

<configuratio n>

<appSettings>
<add key="WhateverVa lue" 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***********@ gaelREMOVETHISq uality.co.uk> wrote in message
news:40******@n ews.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 ConfigurationSe ttings.AppSetti ngs("WhateverVa lue") 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 ConfigurationSe ttings.AppSetti ngs("WhateverVa lue") 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:

<configuratio n>
<configSections >
<section name="appSettin gs"
type="System.Co nfiguration.Nam eValueFileSecti onHandler, System,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"/>
</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
3012
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 python datastructure (a dictionary?) 4) not requiring any heavy libraries needed (I am distributing my proggie as a py2exe executable and do not want to bloat the size) can you guys suggest some format for this? thanks, max
4
3821
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* access config files. This is version 3, which is a big overhaul. It extends ConfigObj to reading config files with sections and various other simplifications. I find ConfigObj extremely easy to use and use it for reading config files and data...
16
4190
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 doesn't use the changed values in the App.config, but continue to use the values that were there during start-up. Is there a way to let the application use the new values in the App.config? Is there kind of some 'refresh' function that I should...
3
2599
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 this. Thanks in Adv. Regards,
16
1984
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 do I mock up what ASP does to read the Web.Config file? I've tried messing around in the System.Configuration library and haven't been able to find anything from taking a quick look at the objects and their methods (for the goal of populating the...
5
2282
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 a web application and if I need to read the connection string it is reading the connection string from the web.config of web application. I am not knowing how to change the Application domain so that it reads the App.config file instead of...
3
3811
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. Then I created a C# test application and ran the function. The function fails because the configuration read is failing to find a key. I created an application config and copied the keys over to the app config file but the app is still failing to...
17
3240
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 production. I'm in the process of writing a site that will have lots of traffic so I'm trying to save resources everyplace that I can. My question is - do the web.config app settings get loaded once when the
5
10333
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 get the following error on the page: Security Exception Description: The application attempted to perform an operation not allowed
5
2851
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 = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath) Dim section As New MembershipSection section = rootWebConfig1.GetSection("system.web/membership")
0
8192
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8696
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7188
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6119
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1504
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.