Hi all
I posted this in the MVP ASP.NET Forum but I can't seem to make my posts sho
w up in the list.
Paulo Morgado
Portugal
I'm getting the error below when truing to view the details in trace.axd.
What can this be?
Paulo Morgado
Server Error in '/worklog' Application.
----
--
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the cur
rent web request. Please review the stack trace for more information about t
he error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set t
o an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an o
bject.]
System.Web.Handlers.TraceHandler.CreateControlTable(DataTable datatable) +19
74
System.Web.Handlers.TraceHandler.ShowDetails(DataSet data) +198
System.Web.Handlers.TraceHandler.System.Web.IHttpHandler.ProcessRequest(Http
Context context) +559
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionSte
p.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&complete
dSynchronously) +87Hi Paulo,
I have checked the stack trace, this error can be related with
CreateControlTable.
We can also find the following information for CreateControlTable:
private static System.Web.UI.WebControls.Table
CreateControlTable(System.Data.DataTable datatable)
It seems that the error message is related with the controls on your web
application.
Paulo, according to the stack trace, it is really hard for me to find out
more information. Can you help to collect some additional information?
Thanks for your effort and time.
1. Please share the sample code which will cause the NullReferenceException
on your side. I will perform more research based on the code.
2. Please let me know the .NET Framework version you installed on the
machine, 1.0 or 1.1.
We can check this information in the Add or Remove Programs in the
Control Panel.
I look forward to hearing from you soon. Have a nice day!
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Hi Paulo,
Thanks for your sharing.
To make the application run on my side, I performed the following
modifications:
1. Change the connection string in web.config:
<add key="ConnectionString" value="packet size=4096;user
id=sa;password=11111111;data source=localhost;persist security
info=False;initial catalog=Northwind" />
I also created the table "ESIAHD_TicketHistoricoVista" in the "Northwind"
database with the following columns:
HistoricoID
Date
CaseID
2. Simplified the Reperter component like following:
<asp:repeater id="ListHistoryTicket" runat="server">
<ItemTemplate>
<tr class="thf2c">
<td class="thf2c"> <%# DataBinder.Eval(Container.DataItem, "Data",
"{0:yyyy-MM-dd HH:mm:ss}") %> </td>
</tr>
</ItemTemplate>
<HeaderTemplate>
<table class='tblsize' border="0" cellpadding='0' cellspacing='1'
width="100%">
<thead>
<tr>
<th class="thf">
Data</th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<FooterTemplate>
<tfoot>
</tfoot>
</tbody></table>
</FooterTemplate>
</asp:repeater>
3. Change the code like following:
comando.CommandText = @."select HistoricoID, Data from
dbo.ESIAHD_TicketHistoricoVista where CaseID = @.CaseID";
Run the application and checked with trace.axd. Everything works fine.
Paulo, I also attached the modified sample in this message and will also
send it to you via email. Can you try to test with the modified sample
again? If there is still a problem, please try the modified sample on
another web site or on another machine. Please let me know the result.
Thanks for your effort and time!
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Working on a Windows 2000 5.00.2195 SP2 and .NET Framework 1.1
The application is working fine. I'm having trouble only with the trace.
web.config:
<?xml version="1.0" encoding="utf-8" ?><configuration><system.web><compilati
on defaultLanguage="c#" debug="true" /><customErrors mode="RemoteOnly" defau
ltRedirect="Erro.htm" /><authentication mode="None" /><authorization><allow
users="*" /><!-- Allow all
users --></authorization><trace enabled="true" requestLimit="10" pageOutput=
"false" traceMode="SortByTime" localOnly="true" /><sessionState mode="InProc
" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data so
urce=127.0.0.1;Trusted_Conn
ection=yes"
cookieless="false" timeout="20" /><globalization requestEncoding="utf-8" res
ponseEncoding="utf-8" /></system.web><appSettings><add key="ConnectionString
" value="whatever" /></appSettings></configuration>
Xref: kermit microsoft.public.dotnet.framework.aspnet:264481
Hi Paulo,
Yes, generally speaking "Trace" is seperate from application code. However,
some times trace will also report errors when there are some issues with
the configuration or code.
According to your last information, the error does not appear on the
Windows XP machine, I suggest that we perform the following steps to
further narrow down this issue besides running the sample application:
1. Create one empty web application on the production or test server.
2. Enable Trace to the "@.Page" directive.
3. Now, please check if there is any error message when running the web
application.
4. If everything is OK, add code like following to Page_Load:
Trace.Write("test");
5. Run the web application again and check if there is any error message.
If there is any new finding, feel free to let me know. Thanks!
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Hi Paulo,
You means even a simple project will also suffer the problem on the win2k3
server ? If so, I suspect that whether the ASP.NET is correctdly installed
or is corrupted on the server machine. Would you please try reinstalling
the ASP.NET via the
"aspnet_regiis -i" in command in the vs.net commandline prompt?
For more detailed info on the aspnet_regiis tool, you may view the
following reference in MSDN:
#ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
http://msdn.microsoft.com/library/e...netiisregistrat
iontoolaspnet_regiisexe.asp?frame=true
If you have any new findings, please feel free to post here. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Paulo,
You mean after run the
aspnet_regiis -i in the commandline, all the aspx page on your machine
can't be requested(return 404 error)? If so, it doesn seems so strange.
Have you installed both .net framework1.0 and 1.1 on this machine? If so,
which version's regiis tool have you used?
the one under
F:\WINDOWS\Microsoft.NET\Framework\v1.0.3705
is for 1.0
and the one under
F:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
is for 1.1
I think you can directly go to the
F:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 folder and
run
aspnet_regiis -u to remove the asp.net and
then run
aspnet_regiis -i again to install and see whether it helps.
Also, since the 404 error is generally returned by IIS, I recommend that
you have a check in the IIS log to see whether it can provide any clues.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Paulo,
If you select "clear current trace", and then add some information to the
trace log and thow the trace details again, Can this fixed the problem?
Luke
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Saturday, March 24, 2012
System.NullReferenceException on trace.axd
Labels:
alli,
asp,
morgadoportugali,
mvp,
net,
paulo,
systemnullreferenceexception,
traceaxd
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment