Paul
Paul

Reputation: 12819

Problem using Razor after migrating MVC 2.0 to MVC 3.0 RC

I migrated a MVC 2.0 site to MVC 3.0, using that : Migrating MVC 2.0 -> 3.0

Using ASPX as View Engine works great now...

But I tried to create a Razor view and got that error:

The view 'TestView' or its master was not found. The following locations were searched:

    ~/TestView.aspx
    ~/TestView.ascx
    ~/Views/Color/TestView.aspx
    ~/Views/Color/TestView.ascx
    ~/Views/Shared/TestView.aspx
    ~/Views/Shared/TestView.ascx

How can I enable razor on that?

I´m using Visual Studio 2010... Creating a brand new MVC 3 Web Application enables Razor fine!

Thanks

Upvotes: 4

Views: 489

Answers (2)

Buildstarted
Buildstarted

Reputation: 26689

Try adding ViewEngines.Engines.Add(new RazorViewEngine()); to your global.asax file

Upvotes: 7

mbr
mbr

Reputation: 333

Please review

In Solution Explorer, delete the reference to System.Web.Mvc (which points to the version 2 DLL). Then add a reference to System.Web.Mvc (v3.0.0.0). Also add a reference to System.WebPages.dll and System.Web.Helpers.dll.

Upvotes: -1

Related Questions