"The name 'HTML' does not exist in the current context" in MVC 3 Views

Clean your solution and Under references. Then set the follow property:

System.Web.MVC file to Copy Local = True.

I have solved this issue with the old, good, wise Microsoft default solution: reinstall all the things again.

Uninstall and Reinstall the Visual Studio 2010 and MVC 3 Framework.


You could try:

  1. Close the View with the false errors.

  2. (Steps 2-5 are sometimes optional) Close Visual Studio

  3. Delete the bin and obj folders in all the Projects in the Solution.

  4. Reopen the same Solution

  5. Rebuilt the Solution

  6. Open a different View then the one causing the errors

  7. Close that View, hopefully you didn't see any of the similar errors in this View

  8. Reopen the View that gave you problems earlier