Error when visiting the blog

May 13, 2008 at 10:39 PM
I get the following error when I try to go to the blog home page.  Any ideas how to fix this?

<title>Object reference not set to an instance of an object.</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style>

Server Error in '/blog' Application.

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 99: 	private void AddMetaKeywords()
Line 100:	{
Line 101:		if (Category.Categories.Count > 0)
Line 102:		{
Line 103:			string[] categories = new string[Category.Categories.Count];

Source File: c:\inetpub\vhosts\craigandheidi.net\httpdocs\blog\default.aspx.cs    Line: 101

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   BlogEngine.Core.Category.get_Categories() in C:\Documents and Settings\Mads Kristensen\Skrivebord\BlogEngine.Core\Category.cs:105
   _default.AddMetaKeywords() in c:\inetpub\vhosts\craigandheidi.net\httpdocs\blog\default.aspx.cs:101
   _default.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\craigandheidi.net\httpdocs\blog\default.aspx.cs:49
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   BlogEngine.Core.Web.Controls.BlogBasePage.OnLoad(EventArgs e) in C:\Documents and Settings\Mads Kristensen\Skrivebord\BlogEngine.Core\Web\Controls\BlogBasePage.cs:62
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
<!-- [NullReferenceException]: Object reference not set to an instance of an object. at BlogEngine.Core.Category.get_Categories() in C:\Documents and Settings\Mads Kristensen\Skrivebord\BlogEngine.Core\Category.cs:line 105 at _default.AddMetaKeywords() in c:\inetpub\vhosts\craigandheidi.net\httpdocs\blog\default.aspx.cs:line 101 at _default.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\craigandheidi.net\httpdocs\blog\default.aspx.cs:line 49 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at BlogEngine.Core.Web.Controls.BlogBasePage.OnLoad(EventArgs e) in C:\Documents and Settings\Mads Kristensen\Skrivebord\BlogEngine.Core\Web\Controls\BlogBasePage.cs:line 62 at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\blog\a17638f8\9814dadb\App_Web_uulb2etq.4.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->