Object reference not set to an instance of an object.

Nov 12, 2010 at 10:10 AM

Environment details:

  • Windows 2003
  • TFS 2008
  • Team System Web Access 2008
  • SQL Server 2005
  • .Net Framework 3.5 SP1
  • Scrum for Team System v2
  • Scrum Dashboard v2.5.0.1

I think I have followed all the installation inctructions to the tee. I even downloaded the code for changeset 58734 and tried to run it off the TFS server, with the same result.

I get the following error when trying to launch the web page: (http://localhost:8090/ScrumDashboard/default.aspx)

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:

Line 1:  <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SprintQuickStats.ascx.cs" Inherits="ScrumDashboard.ui.SprintQuickStats" %>
Line 2:  <div class="QuickStatNotDone">
Line 3:      <div class="QuickStatsNumber"><%=((ScrumDashboard._Default)Page).ViewData.Statistics.ItemsNotDone%> h</div>
Line 4:      <div class="QuickStatsTitle">Not Done</div>
Line 5:  </div>

Source File: c:\Inetpub\ScrumDashboard\web\ui\SprintQuickStats.ascx    Line: 3

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   ASP.ui_sprintquickstats_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Inetpub\ScrumDashboard\web\ui\SprintQuickStats.ascx:3
Nov 12, 2010 at 10:54 AM

I edited the C:\Inetpub\ScrumDashboard\web\ui\SprintQuickStats.ascx file so that the line 3 in error above now checks for the object being null. Atleast the page loads in the browser now, without any values though.

    <div class="QuickStatsNumber"><%if (!(((ScrumDashboard._Default)Page).ViewData == null)) Response.Write(((ScrumDashboard._Default)Page).ViewData.Statistics.ItemsNotDone);%> h</div>

(Not a clean way to do it, I know.)