Eric
Aug 26, 2014
  7054
(3 votes)

500 Internal Server Error in the gadget, 404 handler for CMS 7, from BV Network (MVC)

Installing the common 404 handler that is available via nuget.episerver.com or via the project website, http://world.episerver.com/Blogs/Per-Magne-Skuseth/Dates/2013/2/404-handler-for-EPiServer-7/ https://www.coderesort.com/p/epicode/wiki/404Handler#Custom404HandlerforEPiServer7 should be easy but sometimes things might be more troublesome than you think.

So this blog post is going to be short but describing the error and my solution Ler

 

The Error

Everything is installed without any problem but when trying to use the gadget I got an error message.

When trying to add the gadget to the dashboard I got this error: Sorry, an error occurred. That didn’t tell us much but since most of us are using modern browsers, hitting the f12 button will fire the developer tools. Looking in the console window I found out that I had a 500 Internal Server Error:

error1

The actual error message was this:

Server Error in '/' Application.
________________________________________
Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error: 
Line 13:         controller or action.
Line 14:     -->
Line 15:     <pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Line 16:       <controls>
Line 17:         <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />

Source File: c:\users\admerpe\documents\visual studio 2013\Projects\SVK.Web\SVK.WebUI\modules\bvnetwork.filenotfound.redirectgadget\views\web.config    Line: 15 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
VARN: Loggningen av sammansättningsbindningen är inaktiverad.
Du kan aktivera felloggning för sammansättningsbindningar genom att ange registervärdet [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) till 1.
Obs! Prestanda kan försämras något med felloggning för sammansättningsbindningar.
Du kan inaktivera funktionen genom att ta bort registervärdet [HKLM\Software\Microsoft\Fusion!EnableLog].


________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446 

The Solution

And that told us exactly what was wrong. Since my solution is build with MVC we get web.config-files in our views folder. This is also the case for this module. The config-file for this module told us to use MVC 2 but since this was a new computer with the latest installation I did not have MVC 2 installed.

The solution was to copy the config for the <pages>-tag from the web.config in the views-folder. This config file has the 4.0 version.

   <pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>

Another solution could be to install MVC 2 but that you will have to test your self. But using Web Platform installer from Microsoft will do it for you if you like to test that your self.

Aug 26, 2014

Comments

Please login to comment.
Latest blogs
My blog is now running using Optimizely CMS!

It's official! You are currently reading this post on my shiny new Optimizely CMS website.  In the past weeks, I have been quite busy crunching eve...

David Drouin-Prince | Jan 12, 2025 | Syndicated blog

Developer meetup - Manchester, 23rd January

Yes, it's that time of year again where tradition dictates that people reflect on the year gone by and brace themselves for the year ahead, and wha...

Paul Gruffydd | Jan 9, 2025

Side by side editing - alternative to Optimizely On-Page Edit

Combining the All Properties Mode with a self-updating preview in the Optimizely CMS

Bartosz Sekula | Jan 9, 2025 | Syndicated blog

ImageFile alt-description validation attribute

A customer wanted to improve their quality of having meta descriptive texts on all their published images but it was ok that it could take some tim...

Per Nergård | Jan 7, 2025

Custom Sitemap.xml generator in Optimizely CMS 12

This is a step by step guide to generate sitemap.xml file for all the sites in optimizely cms 12. The sitemaps are generated under wwwroot/sitemaps...

sunylcumar | Jan 7, 2025

Build a headless blog with Astro and Optimizely SaaS CMS Part 3

It is finally time to explore my basic blog example powered by Astro and Opti SaaS CMS. For those new to the series, you may want to read parts one...

Jacob Pretorius | Jan 6, 2025