Can I use System.Web.Mvc from a Class Library?

Chase Florell picture Chase Florell · Jun 4, 2010 · Viewed 12.7k times · Source

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 is
Using 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?

Answer

Chase Florell picture Chase Florell · Jun 4, 2010

Turns out that the System.Web.MVC Assembly is NOT installed in the GAC. It has to be referenced from
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies