0
votes

I get the following error when i deploy mvc 2 application , my target framework is 4.0

Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified

1

1 Answers

0
votes

]I'm guessing you haven't installed MVC2 on your target machine.

Get it from here.

You can't do this - Razor doesn't exist in MVC2. It was only introduced in MVC3. In your web.config in the root and in the ~/Views/ folder, find any references to System.Web.WebPages.Razor and delete them.

If you're using Razor for any of your views then you are most likely going to need to downgrade to MVC3. The easiest way to do that, also, will be to create a new MVC3 project and re-add all your controllers and views.