When trying to compile views, VS gives the following error:

Description: An error occurred during the compilation of a resource required to service this request. Review the following information for this error and modify the source code accordingly.

Compiler error message: CS0234: The name of the type or namespace "Ajax" is missing in the namespace "System.Web.Mvc" (missing the link to the assembly?)

Source Error:

Строка 22: using System.Web.WebPages; Строка 23: using System.Web.Mvc; Строка 24: using System.Web.Mvc.Ajax; Строка 25: using System.Web.Mvc.Html; Строка 26: using System.Web.Routing; 

although in using I have using System.Web.Mvc;

what could it be?

The application does not do anything, it should simply generate a page.

1 answer 1

https://stackoverflow.com/questions/26804198/ajax-does-not-exist-in-the-namespace-system-web-mvc

I translate:

You have an old version of System.Web.Mvc.dll connected, which lacks the namespace System.Web.Mvc.Ajax.

Select this dll in the Solution tree and check the version number in Properties.

Right-click in the Solution panel and select "Manage NuGet Packages", find ASP.NET MVC and click Install.

  • Version v4.0.30319 - Ildarik07
  • How to install a new version? - Ildarik07
  • This is the .NET runtime version, not ASP.NET MVC. Added by. - Igor
  • But how to add and how to see the version of ASP.MVC - Ildarik07
  • In Properties System.Web.Mvc.dll there is a line of Version. What is written there? - Igor