Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing VS2012 (which includes MVC4) breaks existing ASP.NET MVC 3 app

After installing VS2012 and hereby MVC 4, I have an MVC3 application which now fails with the following runtime error:

Method not found: 'System.Collections.Generic.Dictionary`2 System.Web.Razor.Parser.CSharpCodeParser.get_RazorKeywords()'.

If I create a new ASP.NET MVC 3 project in VS2010 it works ok with razors views. Has anybody else experienced similar issues?

like image 736
ssn Avatar asked Aug 22 '12 12:08

ssn


People also ask

What is ASP.NET MVC4?

ASP.NET MVC 4 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of the ASP.NET and the . NET framework. This new, fourth version of the framework focuses on making mobile web application development easier.

Which of the following lifecycle does ASP.NET MVC 3.0 have?

MVC actually defined in two life cycles, the application life cycle, and the request life cycle.

Can I uninstall Microsoft ASP.NET MVC 4 runtime?

Can I delete this file? YES. However, you absolutely do NOT want to remove the folder Controllers, because its existence is how ASP.NET MVC works in 99.99% of all apps.


1 Answers

@Levi it was in Web.config in the root of the project.

In my web.config I noticed this block which I have now commented out, and now this error does not happen anymore:

<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> 
like image 146
ssn Avatar answered Sep 16 '22 22:09

ssn