I ran in to this problem setting up an older Optimizely website running on .Net Framework. The view mode of the website worked just fine, however, when trying to access the edit mode via /episerver/cms, the following exception was thrown.
[NullReferenceException: Object reference not set to an instance of an object.]
EPiServer.Shell.Web.Mvc.HttpContextBaseExtensions .SetCulture(HttpContextBase httpContext, ICurrentUiCulture currentUiCulture) +207
EPiServer.Shell.Web.Mvc.ModuleMvcHandler .ProcessRequestInit(HttpContextBase httpContext) +25
EPiServer.Shell.Web.Mvc.ModuleMvcHandler .BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +16
System.Web.CallHandlerExecutionStep.System.Web .HttpApplication.IExecutionStep.Execute() +970
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158
Getting at least some hints from the post Object Reference while trying to access epicms in local machine – https://local.XXXX.com/episerver on the forum, I realized that I needed to ensure all of the required IIS features was activated.
So you probably just need to activate ASP.NET 4.8 and .NET Extensibility 4.8 to get rid of this problem.

Sorry for the Swedish picture.