views:

51

answers:

2

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?

+1  A: 

I believe the MVC stuff is in the System.Web.Mvc assembly. There should be nothing wrong with referencing that from a class library.

Dean Harding
A: 

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

rockinthesixstring
Oh yes, that's a good point. It actually is in the GAC, but something that trips a lot of people up is the fact that the ".NET" tab on the Add References window is actually *not* just an enumeration of the GAC. [See here for more details](http://stackoverflow.com/questions/495973/getting-assemblies-to-show-in-the-net-tab-of-add-reference)
Dean Harding