Henrik Fransas
May 29, 2015
  5741
(3 votes)

A breaking change in EPiServer 8 that are not on the list

EPiServer has defined all the breaking changes for EPiServer 8 on this page:

http://world.episerver.com/documentation/Items/Upgrading/EPiServer-CMS/8/Breaking-changes/

There are one change that effected me and that was not on the list and it is for the function GetVirtualPath of UrlResolver.

In EPiServer 7.5 GetVirtualPath returns a string directly but in EPiServer 8 it returns System.Web.Routing.VirtualPathData

Actually GetVirualPath were marked as obsolete in 7.5 so you could think that it would be removed in EPiServer 8 but it is not and another big differens is that if you have a contentreference that has the url "section/subsection/pagename" GetVirtualPath([ContentRef]).VirtualPath will return "section/subsection/pagename". In 7.5 GetVirtualPath for the same content returned "/section/subsection/pagename".

The way to solve this is to do as EPiServer told as in 7.5 and that is to change from GetVirtualPath() to GetUrl() and all will work (and it returns a "/" url for the content)

Just thought I should share this with you, since it caused me some headache and took some time to find (the thing with "section" instead of "/section" url)

May 29, 2015

Comments

Please login to comment.
Latest blogs
Keynote Summary from Opticon 2024, Stockholm

At Opticon in Stockholm, marking the 30th anniversary of Optimizely, the company celebrated significant achievements. These included surpassing $40...

Luc Gosso (MVP) | Sep 11, 2024 | Syndicated blog

Introducing Search & Navigation Import/Export functionality

We introduce a small but helpful funcionality for customers which allow customers import/export list of Related Queries , Synonyms , Autocomplete a...

Manh Nguyen | Sep 11, 2024

SNAT - Azure App Service socket exhaustion

Did you know that using HttpClient within a using statement can cause SNAT (Source Network Address Translation) port exhaustion? This can lead to...

Oleksandr Zvieriev | Sep 9, 2024

Micro front-ends are massive for Optimizely One

Optimizely products have evolved. Their new generation of products changes the game.

Mark Everard | Sep 9, 2024 | Syndicated blog

Micro front-ends are massive for Optimizely One

Optimizely products have evolved. Their new generation of products changes the game.   A multi-year journey for Optimizely. They have engineered...

Mark Everard | Sep 9, 2024 | Syndicated blog

Handling Nynorsk and Bokmål in Optimizely CMS

Warning: Blog post about Norwegian language handling (but might be applicable to other languages and/or use cases). Optimizely have flexible and...

Haakon Peder Haugsten | Sep 5, 2024