473,394 Members | 1,726 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,394 software developers and data experts.

Problem Accessing Web.Config File

I have some appsettingin my ASP file. I try to do the following:

Colors(0) = ConfigurationSettings.AppSettings("AltColor1")
Colors(1) = ConfigurationSettings.AppSettings("AltColor2")
TitleColor = ConfigurationSettings.AppSettings("TitleColor")

This works fine in my development directory but when I move it to my testing
web site I get a System.NullReferenceException: Object reference not set to
an instance of an object.

I copied over the dll file, the aspx file and the web.config file. I
figured this was all I needed. Any thoughts?

Thanks
Chris
Nov 18 '05 #1
4 1509
Sorry I just realized that the next line of code where I use TitleColor is
what is throwing that exception. My real question becomes why I'm not
getting the values out of the web.config file. Thanks

Chris

"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:u3**************@TK2MSFTNGP11.phx.gbl...
I have some appsettingin my ASP file. I try to do the following:

Colors(0) = ConfigurationSettings.AppSettings("AltColor1")
Colors(1) = ConfigurationSettings.AppSettings("AltColor2")
TitleColor = ConfigurationSettings.AppSettings("TitleColor")

This works fine in my development directory but when I move it to my testing web site I get a System.NullReferenceException: Object reference not set to an instance of an object.

I copied over the dll file, the aspx file and the web.config file. I
figured this was all I needed. Any thoughts?

Thanks
Chris

Nov 18 '05 #2
GUH.... Sorry I'm just a moron.... I have it working the way it was...

"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:u3**************@TK2MSFTNGP11.phx.gbl...
I have some appsettingin my ASP file. I try to do the following:

Colors(0) = ConfigurationSettings.AppSettings("AltColor1")
Colors(1) = ConfigurationSettings.AppSettings("AltColor2")
TitleColor = ConfigurationSettings.AppSettings("TitleColor")

This works fine in my development directory but when I move it to my testing web site I get a System.NullReferenceException: Object reference not set to an instance of an object.

I copied over the dll file, the aspx file and the web.config file. I
figured this was all I needed. Any thoughts?

Thanks
Chris

Nov 18 '05 #3
Just sitting here enjoying the monologue! <grin>

"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
GUH.... Sorry I'm just a moron.... I have it working the way it was...


Nov 18 '05 #4
Hi Chris,

Is the production site set as an Application in IIS?

It sounds like your web.config is not being read because the app is using a
config file from higher up in the chain.

"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
Sorry I just realized that the next line of code where I use TitleColor is
what is throwing that exception. My real question becomes why I'm not
getting the values out of the web.config file. Thanks

Chris

"Chris" <cf@NoSpamzieQuotepro.com> wrote in message
news:u3**************@TK2MSFTNGP11.phx.gbl...
I have some appsettingin my ASP file. I try to do the following:

Colors(0) = ConfigurationSettings.AppSettings("AltColor1")
Colors(1) = ConfigurationSettings.AppSettings("AltColor2")
TitleColor = ConfigurationSettings.AppSettings("TitleColor")

This works fine in my development directory but when I move it to my

testing
web site I get a System.NullReferenceException: Object reference not set

to
an instance of an object.

I copied over the dll file, the aspx file and the web.config file. I
figured this was all I needed. Any thoughts?

Thanks
Chris



Nov 18 '05 #5

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

Similar topics

15
by: Ron L | last post by:
We are working on a distributed VB.Net application which will access a SQL database located on a known server. Each client will run on the user's local machine. To implement this, we are trying...
4
by: Kaush | last post by:
Hi all, I am creating a webservice to accept SOAP messages, parse the message and send a SOAP response back to the client accessing my web service using WSE-2 in ASP.NET. I am creating a class...
1
by: muthu | last post by:
Hi guys, Iam using dot framework 2.0.vs.net2005.I created a class library project and added a class file.And also i added a app.config file.And i declared a connection string in that config...
3
by: Alok yadav | last post by:
I have an open IP and on that IP our main application is hosted. it uses ajax. in web.config file i have register ajax handlers. there are also other sites or project on that IP. now my problem is...
1
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and...
0
by: valdas | last post by:
Hi, I have a problem in accessing "sqlServerCatalogNameOverwrites" section in app.config file. <configuration> <configSections> <section name="sqlServerCatalogNameOverwrites" ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.