Try our conversational search powered by Generative AI!

Episerver Upgrade - EPiServer.Web.Routing.Segments.RequestSegmentContext Error


I'm in the process of upgrading Episerver from 9.8, to 10.10.1. During this process, I've hit a ton of issues but I'm making my way through them. The latest issues however I'm not sure where to start. I'm getting an error while trying to load up EPiServer.Web.Routing.Segments.RequestSegmentContext, however, I see no reference to this in my solution/codebase.

Where would be a good place to start debugging this issue?

My specific error is...

Server Error in '/' Application.

Could not load type 'EPiServer.Web.Routing.Segments.RequestSegmentContext' from assembly 'EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type 'EPiServer.Web.Routing.Segments.RequestSegmentContext' from assembly 'EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[TypeLoadException: Could not load type 'EPiServer.Web.Routing.Segments.RequestSegmentContext' from assembly 'EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.]
ImageResizer.Plugins.EPiServerBlobReader.EPiServerBlobReaderPlugin.OnPostAuthorizeRequestStart(IHttpModule sender, HttpContext context) +0
ImageResizer.Configuration.RequestEventHandler.Invoke(IHttpModule sender, HttpContext context) +0
ImageResizer.Configuration.PipelineConfig.FirePostAuthorizeRequest(IHttpModule sender, HttpContext httpContext) +154
ImageResizer.InterceptModule.CheckRequest_PostAuthorizeRequest(Object sender, EventArgs e) +157
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1073.0

Jul 31, 2017 23:13


Aug 01, 2017 15:00

That type has been moved to an internal namespace, so now the type is (including namespace) EPiServer.Web.Routing.Segments.Internal.RequestSegmentContext. The move was part of a larger code refactoring that was done in the major release 9->10.

In your case it seems that something (from stacktrace it seems to be ImageResizer) has serialized that type to some storage and then tries to deserialize it, which will fail as above since the type has been moved.

Aug 01, 2017 15:19

I upgraded the ImageResizer nuget package and this resolved my issue.



Aug 01, 2017 15:27
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.