Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred.

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

Source Error:


Line 113:        }
Line 114:
Line 115:        @Html.Sitecore().Placeholder("pagecontent")
Line 116:        @Html.Sitecore().Rendering("/sitecore/Layout/Renderings/Starkey2015/Global/Footer/Footer", new { DataSource = Model.GlobalSiteContent.Id.ToString() })
Line 117:        @Html.RenderScripts()

Source File: d:\Sitecore\Website\Sites\Starkey2015\Views\Layouts\MainLayout.cshtml    Line: 115

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   Starkey.Replatform.Web.Sites.Starkey.Controllers.BlogController.FetchRecentArchives() in d:\vsts1\415\s\Starkey.2015.Web\Sites\Starkey2015\Controllers\BlogController.cs:59

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +194
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +100
   System.Activator.CreateInstance(Type type) +11
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +75

[InvalidOperationException: An error occurred when trying to create a controller of type 'Starkey.Replatform.Web.Sites.Starkey.Controllers.BlogController'. Make sure that the controller has a parameterless public constructor.]
   System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +242
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +103
   Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName) +95

[ControllerCreationException: Could not create controller: 'Blog'. 
The context item is: '/sitecore/content/Starkey International/StarkeyUS/hearing-aids/technologies/muse-iq-wireless-hearing-aids'. 
The current route url is: '{*pathInfo}'. This is the default Sitecore route which is set up in the 'InitializeRoutes' processor of the 'initialize' pipeline. ]
   Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName) +171
   Sitecore.Mvc.Controllers.ControllerRunner.GetController() +23
   Sitecore.Mvc.Controllers.ControllerRunner.Execute() +42
   Sitecore.Mvc.Presentation.ControllerRenderer.Render(TextWriter writer) +128
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) +147
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args) +73
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +465
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.Render(String placeholderName, TextWriter writer, RenderPlaceholderArgs args) +183
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +465
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Helpers.SitecoreHelper.Placeholder(String placeholderName) +258
   ASP._Page_Sites_Starkey2015_Views_Layouts_MainLayout_cshtml.Execute() in d:\Sitecore\Website\Sites\Starkey2015\Views\Layouts\MainLayout.cshtml:115
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +136
   Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +315

[InvalidOperationException: Error while rendering view: '/Sites/Starkey2015/Views/Layouts/MainLayout.cshtml' (model: 'Starkey.Replatform.Models.Pages.Page, Starkey.Replatform.Models').
]
   Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +787
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) +147
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args) +73
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +465
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Presentation.RenderingView.Render(ViewContext viewContext, TextWriter writer) +331
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +39


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4087.0