I'm working on an ASP.NET MVC application, but I'm trying to remove everything but Controller code from my project and put it in it's own Class Library.
I've got some code that isUsing System.Web.Mvc;
But it doesn't seem to be letting me access it. I have Referenced the System.Web
Namespace in the project.
Bassically I'm getting errors on the iActionFilter and the FilterAttribute stuff.
What am I missing?
The System. Web. Mvc namespace contains classes and interfaces that support the ASP.NET Model View Controller (MVC) framework for creating Web applications. This namespace includes classes that represent controllers, controller factories, action results, views, partial view, model binders, and much more.
So for adding a library to the solution, right-click on the project in the Solution Explorer then select Add -> New Project. Then the New Project screen will be shown. From that screen we will select "Windows" -> "Class Library" and provide this library a meaningful name such as “BusinessLayer”.
Turns out that the System.Web.MVC
Assembly is NOT installed in the GAC. It has to be referenced fromC:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies
Web.Mvc was not in Extensions for me. You can install if from nuget:
PM> Install-Package Microsoft.AspNet.Mvc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With