How to Fix the Error: “CS0234: The type or namespace name 'Ajax' does not exist in the namespace 'System.Web.Mvc' (are you missing an assembly reference?)”

Ever seen this error message before?

MVC Error

If so, the reason is that when you created your Asp.Net MVC project, you selected the “Empty” template and added the MVC references as follows:

MVC Error

There are two ways to fix this issue.

First way: Create another project as follows.​

MVC Error Fix

It may look the same as before, but it’s not. There is a bug in the “System.Web.Mvc” assembly that crops up when you create an MVC project the first way shown. An older version of this assembly is embedded into the project.

Microsoft’s Asp.Net MVC Security Update MS14-059 is responsible for this.

Second way: Uninstall the current version of the MVC and download the latest version through the NuGet Package Manager Console.

Uninstall MVC

Install New MVC Version

The latest version is currently 5.2.3.

After installation, you should be able to launch your application properly:

Fix Bug MVC Error

Is it fixed yet? ;)