Follow the below steps to add Razor support to existing ASP.Net MVC 3 project
- Create another Temporary project based on MVC 3 Razor support by default
- Compare the references, web.config (main one and one under views folder) in the Temporary project with my own project. Here I found references to System.Web.Helpers & System.Web.Webpages. Similar mentions exist in the web.config files also. Just copy those sections from the temporary project to your project.
- Copy the _ViewStart.cshtml file from temporary project to your project (under Views folder)
- Copy the _Layout.cshtml file from temporary project to your project (under Views\Shared folder)
- Also check inside _Layout.cshtml. It may be referencing other partial views, jquery (js file) etc. Make sure they all exist in your own project.
- That’s it. Compile and all should be set right.