Possible Duplicate:
The type or namespace name does not exist in the namespace ‘System.Web.Mvc’
When I compile my MVC4 project locally I receive the following error:
CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.Mvc' (are you missing an assembly reference?)
Line 25: <add namespace="System.Web.Mvc" />
Line 26: <add namespace="System.Web.Mvc.Ajax" />
Line 27: <add namespace="System.Web.Mvc.Html" /> <--- this line
Line 28: <add namespace="System.Web.Routing" />
Line 29: <add namespace="System.Web.WebPages" />
What could be causing this? If I push the code to AppHarbor it builds and runs correctly
You also need to set the DLL reference as copy local.
Try adding System.Web.Mvc namespace to the list of assemblies in the compilation section
<compilation debug="true">
<assemblies>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
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