Object Reference while trying to access epicms in local machine - https://local.XXXX.com/episerver


 - dont have any other details logged in episerver log other than the below details. have anyone faced this error before in local machine.. its windows 10 and Visual studio Enterprise 2019

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:

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 object.]
   EPiServer.Shell.Web.Mvc.HttpContextBaseExtensions.SetCulture(HttpContextBase httpContext, ICurrentUiCulture currentUiCulture) +185
   EPiServer.Shell.Web.Mvc.ModuleMvcHandler.ProcessRequestInit(HttpContextBase httpContext) +27
   EPiServer.Shell.Web.Mvc.ModuleMvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +16
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1128
   System.Web.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0() +40
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +155
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134
Edited, Aug 06, 2021 16:49

Does it help if you set * as hostname for the site? And/or set the correct culture for that site?
Admin mode-> Config -> Manage websites -> Click on your site.

Aug 08, 2021 10:01

Thanks for the reply. actually i configured like local.<brandname>.com/episerver . just for security purpose i put xxxxx in hostname .

i am getting "object reference not set to an instance of an object." while trying to access epicms so i cant change any configuration until i login to epicms.

Aug 09, 2021 13:53

If you don't have access to admin mode, you can set hostnames directly in the tblHostDefinition table.

Do you get more info in error logs?

Have you tried to set a breakpoint in global.asax.cs and catch Server.GetLastError()...

If you're using IIS, you might need to install some IIS features, including the URL Rewrite module (https://support.optimizely.com/hc/en-us/articles/115004123226-Installing-Commonly-Used-IIS-Features-Using-Powershell)

Hope this helps!

Edited, Aug 10, 2021 9:20

just out of curiousity, what do you have in `system.web/globalization` element in `web.config` file?

Aug 20, 2021 18:48

Hi All, there was some issue in my IIS and fixing those which fixed the abve error. Its not related to Episerver. Thank you all..

Aug 23, 2021 16:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.