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

Issue with ConfigurationSettings.AppSettings

My application works fine when I run it locally but when I transfer it
to our NEW Windows 2003 Web Edition server, I get a strange error.
I've isolated the problem to when I issue a
ConfigurationSettings.AppSettings["foo"] call.

My guess is, there's a security setting that I'm missing on my Server
but what?? I've spend hours trying to debug this; help on this would
be greatly appreciated...

Here's the error I get:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
[No relevant source lines]
Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary
ASP.NET Files\root\2135a508\8d69a834\ha3wzqyo.0.cs Line: 0

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
nVisionSoftware.registration.test..ctor()
ASP.test_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET
Files\root\2135a508\8d69a834\ha3wzqyo.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of
an invocation.]
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +164

[HttpException (0x80004005): Failed to create page of type
'ASP.test_aspx'.]
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +338
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path) +44
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
+95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously) +173
Nov 18 '05 #1
3 4866
Same page calling this?
Is the Web.Config getting updated on the server? and the right one in the
right location?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Celebrate" <pl****@celebrate-software.com> wrote in message
news:8b**************************@posting.google.c om...
My application works fine when I run it locally but when I transfer it
to our NEW Windows 2003 Web Edition server, I get a strange error.
I've isolated the problem to when I issue a
ConfigurationSettings.AppSettings["foo"] call.

My guess is, there's a security setting that I'm missing on my Server
but what?? I've spend hours trying to debug this; help on this would
be greatly appreciated...

Here's the error I get:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
[No relevant source lines]
Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary
ASP.NET Files\root\2135a508\8d69a834\ha3wzqyo.0.cs Line: 0

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
nVisionSoftware.registration.test..ctor()
ASP.test_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET
Files\root\2135a508\8d69a834\ha3wzqyo.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of
an invocation.]
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +164

[HttpException (0x80004005): Failed to create page of type
'ASP.test_aspx'.]
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +338
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path) +44
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699
System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep
..Execute() +95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously) +173

Nov 18 '05 #2
Here's the Web.Config file, and yes I checked and it's consistant on
both machines.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="EmailFrom" value="ww*@foo.com"/>
<add key="EmailTo" value="fo*@foo.com" />
</appSettings>

<system.web>

<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging.
Otherwise, setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols
(.pdb information)
into the compiled page. Because this creates a larger file
that executes
more slowly, you should set this value to true only when
debugging and to
false at all other times. For more information, refer to the
documentation about
debugging ASP.NET files.
-->
<compilation
defaultLanguage="c#"
debug="true"
/>

<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom
error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.

"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to
users not running
on the local Web server. This setting is recommended for
security purposes, so
that you do not display application detail information to
remote clients.
-->
<customErrors
mode="RemoteOnly"
/>

<!-- AUTHENTICATION
This section sets the authentication policies of the
application. Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or
Integrated Windows) according to
its settings for the application. Anonymous access must be
disabled in IIS.
"Forms" You provide a custom form (Web page) for users to
enter their credentials, and then
you authenticate them in your application. A user
credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized
authentication service provided
by Microsoft that offers a single logon and core profile
services for member sites.
-->
<authentication mode="Windows" />

<!-- AUTHORIZATION
This section sets the authorization policies of the
application. You can allow or deny access
to application resources by user or role. Wildcards: "*"
mean everyone, "?" means anonymous
(unauthenticated) users.
-->

<authorization>
<allow users="*" /> <!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>

<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every
page within an application.
Set trace enabled="true" to enable application trace
logging. If pageOutput="true", the
trace information will be displayed at the bottom of each
page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from
your web application
root.
-->
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>

<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests
belong to a particular session.
If cookies are not available, a session can be tracked by
adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>

<!-- GLOBALIZATION
This section sets the globalization settings of the
application.
-->
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>

</system.web>
</configuration>
Nov 18 '05 #3
Yes to both your questions.
Nov 18 '05 #4

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

Similar topics

6
by: Rob Mayo | last post by:
I'm developing a server control for our intranet. This control is only going to be used in two applications on the server, but they must be separate. It has been established that these 2 apps...
12
by: Bill | last post by:
When I compile the following code fragment, the compiler errors saying the variable connection is not initialized. As I understand C#, I thought it would be initialized. Please help me and explain...
1
by: [myfirstname] | last post by:
Hello I've seen several examples around the web where people put all the values in ConfigurationSettings.AppSettings into Application State variables in global.asax, like this: foreach...
4
by: RSH | last post by:
Hi, I have a situation where I am attempting to print the contents of an AppSettings property in the aspx file of my website. Basically here is the code I am using: <% Response.Write("Email:"...
1
by: Jenny | last post by:
Hello, I read my applications App.Config file using ConfigurationSettings.AppSettings When I try to check it's last access write time using File.GetLastWriteTime and the refresh new data...
3
by: John | last post by:
Hi If I use ConfigurationSettings.AppSettings.Set("KeyName", "KeyValue"), where does the KeyName/KeyValue combination ends up? In a file? In windows registry? Thanks Regards
1
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add...
2
by: mark4asp | last post by:
In trying to get the C# conversion code for Head First Design Patterns to work I came accross a number of warnings. e.g. Warning Number: 10 Description: ...
10
by: jimjim | last post by:
HI, We have shifted our database from sqlserver2003 to sqlserver2005. 1. connection strings stored in web.config <!-- Machine name to connection string keys --> <add key="*777*"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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...

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.