iltelko iltelko -3 years ago 140
C# Question

Where C# System.Web.Mvc Controller class is located, in adding references?

I am trying to create subclass of class "Controller" which is located in System.Web.Mvc namespace. According to source (, it is located in System.web.mvc.dll. I added as reference the "System.Web" in Visual Studio and also tried some other namespaces like System.Web.Abstractions, but I am not able to reference to Controller / System.web.mvc namespace. That dll (System.web.mvc.dll) is not listed in the references, or in extensions. What I am doing wrong?

Answer Source

Maybe you need to actually install MVC. In Visual Studio, go Tools > Nuget package manager > package manager console, then type:

 Install-Package Microsoft.AspNet.Mvc -Version *requiredVersion*

e.g. (latest stable release)

 Install-Package Microsoft.AspNet.Mvc -Version *requiredVersion* 5.2.3
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download