Improve separation between CMS Core and ASP.NET + StructureMap

Fixed in

EPiServer.CMS.Core 10.9.0

Created

Jan 31 2017

Updated

May 08 2017

Area

CMS Core

State

Closed, Fixed


Description

Previously, there were strong dependencies between CMS Core and ASP.NET/System.Web and StructureMap, making it for example hard to upgrade StructureMap and ASP.NET. This story is the first step towards separating the CMS Core APIs from StructureMap and ASP.NET at the class/interface level. Future steps includes moving the integrations with those dependencies to separate NuGet packages.

Most changes are not visible in the public API, but you might be affected by some changes.

  • Container property in the initialization system (ServiceConfigurationContext) has been obsoleted and replaced with a extension method StructureMap() to make sure it can be injected. The Episerver abstractions (the Services property) are not affected.
  • PropertyData.CreatePropertyControl has been obsoleted to separate WebForms controls from PropertyData. Use IPropertyControlFactory to register controls for properties.
  • VirtualPathUtilityEx static methods (which were a wrapper around the ASP.NET VirtualPathUtility) have been obsoleted and replaced with IVirtualPathResolver (and VirtualPathHelper for static methods).
  • CacheSettings.FileNames/CacheEvictionPolicy.Files was obsoleted. (It's not possible to take file dependencies in Core cache abstractions, since they were designed for ASP.NET caching system.)
  • CacheManager.Clear/IObjectInstanceCache.Clear was obsoleted. It cleared the complete ASP.NET cache and is not possible in all cache implementations (use IContentCacheRemover to clear content cache).
  • IStringFragment.GetControl, which loaded a WebForms control, was obsoleted and replaced with IStringFragmentControlResolver.
  • PageAccessControlList was obsoleted. Use ContentAccessControlList.
  • PageData property PageGuid, PageTypeID, etc. have been obsoleted in favor of this Content parts such as ContentGuid, ContentTypeID etc.
  • ClientResourceRegisterAttribute was replaced with ClientResourceRegistratorAttribute. IClientResourceRegister was replaced with IClientResourceRegistrator. (The new API does not expose HttpContext).
  • Geolocation class static properties that directly read ASP.NET configuration werew obsoleted (the same data can be accessed via IoC).
  • MimeMapping static class that directly read ASP.NET configuration was replaced with IMimeTypeResolver.