Showing posts with label Multisite. Show all posts
Showing posts with label Multisite. Show all posts

Tuesday, 14 February 2017

Sitecore.ExperienceExplorer.Business.Pipelines.HttpRequest.EnableExperienceModePipeline.Process exception

When building a Sitecore site sometimes you might suddenly see the following exception thrown as soon as you browse to the site:

[NullReferenceException: Object reference not set to an instance of an object.]
   Sitecore.ExperienceExplorer.Business.Pipelines.HttpRequest.EnableExperienceModePipeline.Process(HttpRequestArgs args) +950
   (Object , Object[] ) +73
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +483
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +21
   Sitecore.Nexus.Web.HttpModule.’ (Object  , EventArgs  ) +531
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91


I discovered this while playing around the Sitecore demo sites that are built on top of Habitat Demo. This issue should only happen on multisite scenario where the Sitecore setting Preview.DefaultSite is set to a site that does not exist.

In my case, I have removed the habitat site and by default the Habitat Demo sets the Preview.DefaultSite value to habitat. Since I do not have it anymore the exception is thrown.

To fix the issue, patch the value of the setting to one of your site's name (which one is up to you).

Hope this helps!