Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7826465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:25:40+00:00 2026-06-02T09:25:40+00:00

I upgraded my web app from MVC3 to 4 recently by creating a new

  • 0

I upgraded my web app from MVC3 to 4 recently by creating a new web application in MVC4, and copying all the files over, and finally merging the web.config. All works well with the existing web app, however I’ve just noticed a very weird error today – if I try to create a new API controller with the default dummy implementation, and then browse to that api (e.g. /api/events), I get a Could not load type error. The weird thing is if I rebuild the app, and hit the URL again, it seems to be a different assembly it’s complaining about, mainly it alternates between these 2:

Could not load type 'System.Web.Razor.Parser.SyntaxTree.CodeSpan' from assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

and

Could not load file or assembly 'Microsoft.Scripting, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1' or one of its dependencies. The system cannot find the file specified.

My web.config contains the following assembly binding information:

 <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <!--<assemblyIdentity name="FluentValidation" publicKeyToken="a82054b837897c66" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" />-->
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.8.0" newVersion="4.0.8.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

And my packages.config looks like it has all the right bits in it:

  <package id="AspNetMvc" version="4.0.20126.16343" />
  <package id="AspNetRazor.Core" version="2.0.20126.16343" />
  <package id="AspNetWebApi" version="4.0.20126.16343" />
  <package id="AspNetWebApi.Core" version="4.0.20126.16343" />
  <package id="AspNetWebPages.Core" version="2.0.20126.16343" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
  <package id="Microsoft.Web.Optimization" version="1.0.0-beta" />
  <package id="System.Net.Http" version="2.0.20126.16343" />
  <package id="System.Net.Http.Formatting" version="4.0.20126.16343" />
  <package id="System.Web.Http.Common" version="4.0.20126.16343" />
  <package id="System.Web.Providers" version="1.1" />
  <package id="System.Web.Providers.Core" version="1.0" />

I’ve even tried copying over my web.config with a “vanilla” one from a new mvc4 web app, which still gives me the same error (could not load file or assembly Microsoft.Scripting)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:25:42+00:00Added an answer on June 2, 2026 at 9:25 am

    Try removing these lines from your web.config

    <dependentAssembly>
      <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded a Web Application Project (as well as some dependent projects) from
I have recently upgraded / deployed a java web application product (which is only
I'm looking to upgrade the upload function of a web app of mine from
I've upgraded an ASP.Net Web application to the latest build of Fluent NHibernate (1.0.0.636)
Today I upgraded our grails app from 1.0.3 to 1.3.3 and, of course, things
My company recently upgraded from IE 6 to IE 8. My site does not
I was happily sending email from my web app using ActionMailer, using ruby 1.9.2-p180.
We recently upgraded from MySQL 5.1.41 to 5.1.61 on our Ubuntu 10.04LTS server. We
I'm trying to upgrade my struts2 web app from guice2.0 to guice3.0. I'm trying
I upgraded my microsof-web-helpers package from nuget and it itself depends on facebook and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.