1

I want to create a mvc3 web razor application in visual studio 2010 professional. I added mvc3 web project with razor view but when i compile it it gives error of MVC.WEB.dll older version. then i updated mvc.web.dll to version 4 and web.mvc.webpages to version 2 in my refference assemblieis.

I already added the web.config file configurations when it gives compile time error as show below

<compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
      </assemblies>
    </compilation>

but now it not give the compile time error as shown below.

Assembly 'MvcApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Please help me to resolve this matter.

andrina churia
  • 173
  • 1
  • 13

2 Answers2

1

I want to create a mvc3 web razor application

and then

i updated mvc.web.dll to version 4

what?

Exception ... which has a higher version than referenced assembly ...

Try to remove reference from project references (left click on System.Web.Mvc and press delete), then References -> Add reference sort by name on first tab and select System.Web.Mvc with 4.0.0.0 in second column (version).

webdeveloper
  • 17,174
  • 3
  • 48
  • 47
  • I already do this but the error is still come at runtime plz give me some other suggestion to resolve it. – andrina churia Nov 05 '12 at 10:47
  • @churahi Look at this link http://stackoverflow.com/questions/10402005/aspnet-compiler-finding-wrong-version-of-system-web-webpages-1-0-0-0-instead-of Where is `` section? – webdeveloper Nov 05 '12 at 11:01
0

Under the References you will find the System.Web.Mvc referenced

enter image description here

remove this reference and add a new reference of higher version i.e 4.x

enter image description here

Dakait
  • 2,531
  • 1
  • 25
  • 43