Failed to retrieve type 'EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider'

Fixed in

EPiServer.CMS.Core 11.9.3

Created

Jun 26, 2018

Updated

Aug 10, 2018

Area

CMS Core

State

Closed, Fixed and tested


Description

Steps to reproduce:

1. Install a sample site: https://github.com/episerver/AlloyDemoKit.
2. Set log level to "Info".
3. Start the site.
4. Observe the log file.

NOTE: This is not actually a problem. When a provider is instantiated, we first attempt to create it from the Container. If the Container throws an exception, we log the exception at INFO level then try and create the provider using the default constructor. As long as this works, the localization remains fully functional. The log messages should be corrected to reflect this.

Expected:
No error.

Actual:

INFO EPiServer.Framework.Internal.ActivatorUtilities: Failed to retrieve type 'EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider' from container container. Attempting to use default constructor.
 
EPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type FileXmlLocalizationProvider, key "" ---> StructureMap.StructureMapConfigurationException: No default Instance is registered and cannot be automatically determined for type 'EPiServer.Framework.FileSystem.IFileSystemWatcher'
There is no configuration specified for EPiServer.Framework.FileSystem.IFileSystemWatcher
1.) new FileXmlLocalizationProvider(*Default of VirtualPathProvider*, *Default of IFileSystemWatcher*, *Default of IHostingEnvironment*)
2.) EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider
3.) Instance of EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider
4.) Container.GetInstance(EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider)
 
 
 
   at lambda_method(Closure , IBuildSession , IContext )
 
   at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context)
 
   at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle)
 
   at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph)
 
   at StructureMap.Container.GetInstance(Type pluginType)
 
   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
 
   --- End of inner exception stack trace ---
 
   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
 
   at EPiServer.Framework.Internal.ActivatorUtilities.GetServiceOrCreateInstance(IServiceLocator locator, Type type)
 
EPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type FileXmlLocalizationProvider, key "" ---> StructureMap.StructureMapConfigurationException: No default Instance is registered and cannot be automatically determined for type 'EPiServer.Framework.FileSystem.IFileSystemWatcher'