Jonas Lindau
Apr 30, 2013
  9938
(0 votes)

The annoying “error CS1031: Type expected” after upgrade site from CMS5R2 to CMS6

A few days ago a colleague upgraded a EPiServer site using Deployment Center and got this strange error. According to the dump the error was related to /Shell/Views/Shared/Site.Master. I knew the site was working correctly on my development machine, and I also knew the site was working fine in the test environment, so I ruled out any code-issues. Since there was already a lot of sites running on the production servers I also ruled out any missing dependencies. So what’s left? The Web.config of course!

The natural approach to find the error was to compare the non-working web.config in the production environment, with the working web.config from the test environment. That turned out to be an easy task since the only thing that was different was three lines, all which had to do with MVC!

For some reason Deployment Center didn’t care to replace the version of MVC on the production servers. It worked for the same site on my development machine and for the test servers. It also always worked for other sites on out production servers, but not this time.

So what I did was change the version numbers for System.Web.Mvc as below:

 

This is how it looked after upgrade

<dependentAssembly>
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  <bindingRedirect oldVersion="1.0.0.0-1.65535.65535.65535" newVersion="1.0.0.0" />
</dependentAssembly>

<compilation defaultLanguage="c#" debug="false">
  <assemblies>
    <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </assemblies>
</compilation>

<pages validateRequest="false" enableEventValidation="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

 

This is what I did change to make it work

<dependentAssembly>
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
  <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>

<compilation defaultLanguage="c#" debug="false">
  <assemblies>
    <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </assemblies>
</compilation>

<pages validateRequest="false" enableEventValidation="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

 

And the error is gone!

Apr 30, 2013

Comments

Please login to comment.
Latest blogs
Zombie Properties want to Eat Your Brains

It’s a story as old as time. You work hard to build a great site. You have all the right properties – with descriptive names – that the content...

Joe Mayberry | Mar 29, 2023 | Syndicated blog

Optimizely finally releases new and improved list properties!

For years, the Generic PropertyList has been widely used, despite it being unsupported. Today a better option is released!

Tomas Hensrud Gulla | Mar 28, 2023 | Syndicated blog

Official List property support

Introduction Until now users were able to store list properties in three ways: Store simple types (int, string, DateTime, double) as native...

Bartosz Sekula | Mar 28, 2023

New dashboard implemented in CMS UI 12.18.0

As part of the CMS UI 12.18.0 release , a new dashboard has been added as a ‘one stop shop’ to enable editors to access all of their content items,...

Matthew Slim | Mar 28, 2023