I my ASP.NET MVC 4 Project, my Global.asax.cs
page shows the error on
WebApiConfig.Register(GlobalConfiguration.Configuration);
In my case I was getting a similar issue in Glabal.asax:
The name 'AreaRegistration' does not exist in the current context.
I already had System.Web.Mvc
namespace in Global.asax.cs
but the compiler was somewhat not aware of it, that is, the AreaRegistration
class was not being found.
What fixed the issue was executing the following command in Package Manager Console inside Visual Studio:
PM> Update-Package -reinstall
After NuGet reinstalled all the project's packages, the missing class names appeared and the code built successfully.
Something is broken in Visual Studio\NuGet restore pipeline...