The type or namespace name 'Mvc' does not exist in the namespace 'System.Web'

Posted by Guy on Stack Overflow See other posts from Stack Overflow or by Guy
Published on 2010-04-22T15:09:23Z Indexed on 2010/04/22 15:13 UTC
Read the original article Hit count: 568

Filed under:
|
|

After converting a Hybrid ASP.NET MVC1 app to MVC2 I'm getting the following error when I try and run the application:

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

The allegeded culprit in the web.config file is System.Web.Mvc:

<namespaces>
    <add namespace="System.Web.Mvc"/>
    <add namespace="System.Web.Mvc.Ajax"/>
    <add namespace="System.Web.Mvc.Html"/>

So far my investigation seems to lead me to believe that version 2 of System.Web.Mvc is not installed or has not been picked up.

I've tried creating a File > New Project based on MVC 2 and that's picking up the new (v2) version of MVC. I've also converted some other projects (that were not hybrids) and they've converted without problem to MVC2.

I've also uninstalled MVC1 to try and remove references to it from the GAC. However, none of this has worked.

Any ideas?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about conversion