Try our conversational search powered by Generative AI!

CSR UI breaks any site with attribute routes registration

Found in

EPiServer.Commerce 12.6.0

Fixed in

EPiServer.Commerce 12.10.0

(Or a related package)

Created

Oct 09, 2018

Updated

Jan 07, 2019

Area

Core

State

Closed, Fixed and tested


Description

CSR UI calls routes.MapHttpRoute in its initialization module. This should be call after config.MapHttpAttributeRoutes() which any site with attribute routes should do. However, currently there is no guarantee for such order, therefore CSR UI will break those sites with this error.

{
    "Message": "An error has occurred.",
    "ExceptionMessage": "The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code.",
    "ExceptionType": "System.InvalidOperationException",
    "StackTrace": "   at System.Web.Http.Routing.RouteCollectionRoute.get_SubRoutes()\r\n   at System.Web.Http.Routing.RouteCollectionRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)\r\n   at System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(HttpContextBase httpContext)"
}