Why is System.Web.Mvc not listed in Add References?

后端 未结 14 2549
日久生厌
日久生厌 2020-12-12 23:25

Using C#, Visual Studio 2010.

There is a namespace called System.Web.Mvc documented on MSDN. The documentation for all the types in that namespace says that they are

相关标签:
14条回答
  • 2020-12-12 23:53

    I had the same issue and wasn't able to locate the System.Web.MVC reference assembly.

    Finally found out and it was located inside the following location.

    Note if your VS was installed in C: (Sometimes the MVC.dll is not in the default location which everybody talk about, i mean the "Reference Assemblies" folder located in the C: drive.)

    if its not there, it should definitely be in here:

    \Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll

    So add the dll through navigating or the browse tab in the add reference menu.

    0 讨论(0)
  • 2020-12-12 23:54

    Best way is to use NuGet package manager.

    Just update the below MVC package and it should work.

    enter image description here

    0 讨论(0)
  • 2020-12-12 23:54

    Check these step:

    1. Check MVC is installed properly.
    2. Check the project's property and see what is the project Target Framework. If the target framework is not set to .Net Framework 4, set it.

    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.

    0 讨论(0)
  • 2020-12-12 23:57

    I solved this problem by searching "mvc". The System.Web.Mvc appeared in search results, despite it is not contained in the list.

    0 讨论(0)
  • 2020-12-12 23:57

    I didn't get System.Web.Mvc in VS 2012 but I got it in VS 2013. Using AddReference Dialog,

    Or, You can find this in your project path,

    YourProjectName\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll

    0 讨论(0)
  • 2020-12-12 23:58

    "OK, adding that XML to the Web.config works, but it doesn’t answer the question"

    It should be there. By default the add references list seems to be ordered, but its not the case. Hit the name header and look again.

    0 讨论(0)
提交回复
热议问题