'System.Web.Mvc.Controller' is defined in an assembly that is not referenced
While I was playing around with the Mvc framework, I received this error message:
The type 'System.Web.Mvc.Controller' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
What this simply means, is that I forgot to reference the System.Web.Extensions within my code, in this case it was by test harness/project.
However, when I looked in the .Net reference table, I couldn't see the 3.6.0.0 assembly listed. I went into the GAC (C:\Windows\Assembly) and there it was listed but it wouldn't let me reference the assembly. Finally, I went to C:\Program Files\Reference Assemblies\Microsoft\Framework\ASP.NET 3.5 Extensions\ and added the reference from there.
Remember, if your creating your own test project with NUnit or MbUnit then you will need to reference System.Web.Extensions within that project as well.
Labels: ASP.net MVC





Blogger comments