0

I am searching for the solution whether how I can mix/add MVC 4/5 stub with my existing ASP.NET 4.0 Website(not application).

I would like to design further changes in MVC format along with whatever which is existed in my current application.

I followed this website but it only shows returning result content and there is no further steps on how we can add view to our website project.

When I have added my own view to the website project, it started throwing me an error as

"Error 2 The pre-application start initialization method Start on type Microsoft.Web.Helpers.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.."

Hence I am now having no clue, please guide on the steps where I can mix/add MVC stub to my asp.net website.

Thanks, Vijay

Sriram Sakthivel
  • 72,067
  • 7
  • 111
  • 189
CSharpDev
  • 370
  • 1
  • 7
  • 28
  • Try including the packages it can't find via NuGet (i.e. System.Web.Razor). – R Day Sep 18 '15 at 07:25
  • Why you want to do that? MVC is created as a `project`. Things are separated for a resaon – Tushar Gupta Sep 18 '15 at 07:36
  • Nope I wanted the same state of my original application, and would like to add MVC stub in to the same. – CSharpDev Sep 18 '15 at 09:35
  • The answer [here](https://stackoverflow.com/a/17800975/12597) gives the steps to have MVC with a web *site*. Controllers go in `App_Code`, views go in `Views`, you have to have all the MVC and related dlls, and also find the other `web.config` that goes in the `Views` folder. – Ian Boyd Nov 21 '19 at 14:57

0 Answers0