Try our conversational search powered by Generative AI!

Site running as Azure Web App throws exception on startup


We're developing a new Commerce solution and we have test/prod environments running as web apps in Azure with automated deployment. 

I configured the solution for Azure using this documentation, and initially it worked fine - but when I made a new deploy to test today, we got this exception on startup:

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Web.Hosting.VirtualPathRegistrationHandler.CreateVirtualPathProviderInstance(ProviderSettings providerSettings) +59
   EPiServer.Web.Hosting.VirtualPathRegistrationHandler.RegisterVirtualPathProvidersFromSettings(ProviderSettingsCollection settings) +172
   EPiServer.Web.Hosting.VirtualPathRegistrationHandler.RegisterVirtualPathProviders(InitializationEngine context, ProviderSettingsCollection settings) +40
   EPiServer.Framework.Initialization.Internal.VirtualPathProviderInitialization.RegisterVirtualPathProviders(InitializationEngine context) +179
   EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +54
   EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +122
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +247

[InitializationException: Initialize action failed for Initialize on class EPiServer.Framework.Initialization.Internal.VirtualPathProviderInitialization, EPiServer.Framework.AspNet, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +774
   EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +198
   EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +876
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +225
   EPiServer.Global..ctor() +103
   ASP.global_asax..ctor() +42

It's been about a month since last time I deployed to this environment, and the codebase has changed a lot (and we've also installed new versions of EPiServer Nuget packages), so it's hard to say what change has caused this (if any). It works fine locally. 

Would very much appreciate it if anyone could give us a nudge in the right direction here.

Versions are: EPiServer.CMS v.11.3.2, EPiServer Commerce v.11.6.1

Edited, Jan 18, 2018 0:08

It seems like you have a wrong configuration in episerverframework.config, the type for any VirtualPathNonUnifiedProvider should be 

 type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework.AspNet"


 type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework"

Jan 18, 2018 9:19

Thanks Quan, that solved it. 

When was this changed? As mentioned, this configuration worked in December (and came with the default installation - we haven't changed it). 

Jan 18, 2018 9:42

It was changed in CMS 11 :), more information can be found here:

basically APIs which dependencies on AspNet were moved to separate packages (with .AspNet suffix)

Jan 18, 2018 9:45

I see - turns out the configuration had been updated correctly by an upgrade of EPiServer, but with the automated deploy it was reverted by a config transform of the episerver.framework section. Anyway, thanks for the quick reply, I spent most of yesterday struggeling with this. 

Jan 18, 2018 9:50
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.