Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Jonas Lindau
Apr 30, 2013
  10547
(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
Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog