Reputation: 21671
I'm reading a blog on how to add MVC functionalities to an existing WebForm application. I've created a WebForm Application. To proceed further, I need to add a number of references to assemblies.
I've been able to add them all, but the System.Web.MVC. There's no such assembly in the Add Reference Dialog box. But, the sample code that I downloaded contains a reference to that assembly.
Any how to overcome that problem?
Upvotes: 7
Views: 29330
Reputation: 469
I answered to same question here. But I repeated my answer:
Check these step:
Note: if target framework is set to .Net Framework 4 Client Profile, it will not list MVC reference on references list. You can find different between .Net Framework 4 and .Net Framework 4 Client Profile here.
The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. It provides functionality for most client applications, including Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and ClickOnce features. This enables faster deployment and a smaller install package for applications that target the .NET Framework 4 Client Profile.
Upvotes: 0
Reputation: 301
Depending on the version of Visual Studio you are using, the MVC framework may not automatically be installed on your computer.
Check here to make sure you have the latest MVC installed
Additional suggestions:
When you go to Project->Add Reference make sure you wait for the list to fully populate and then click the System Component column header (the list is not alphabetized by default). System.Web.MVC should show up between System.Web.Mobile and System.Web.RegularExpression. You will not find System.Web.MVC there if you do not sort the column (even when you reopen the reference list).
If that still does not solve the problem then I would suggest a reinstall or simply dl MVC 3 if it isn't already installed (only MVC 2 will be installed by default) and that should add the System.Web.MVC to your references.
Upvotes: 12