0

I created an MVC project in Visual Studio 2015 and when I compiled it I got this error:

Type name 'Web' does not exist in the type name 'System'

This was in the autogenerated models AccountViewModel and ManageViewModel. I'm surprised to see that there's an error considering that A: These are autogenerated and B: My other very similar projects compiled without this issue.

The code in which it is referencing is:

public class SendCodeViewModel
{
    public string SelectedProvider { get; set; }
    public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
    public string ReturnUrl { get; set; }
    public bool RememberMe { get; set; }
}

and

public class ConfigureTwoFactorViewModel
{
    public string SelectedProvider { get; set; }
    public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; }
}
Nathan McKaskle
  • 2,926
  • 12
  • 55
  • 93
  • 1
    Either 1 - your project does not have the Mvc NuGet package referenced or 2 - the error is not from one of those lines but somewhere else which can happen if you are referencing using a partial namespace like omitting `System`. Alternatively your default namespace might be System or something like that. Or 3 - do you have a type defined named System, in that case prefix the namespace with global like so `global::System.Web.Mvc.SelectListItem`. – Igor Aug 19 '16 at 18:45
  • http://stackoverflow.com/a/7155510/3709746 – Рахул Маквана Aug 19 '16 at 18:45
  • Igor you're right, I just realized I can't use the type "System" as a class, gotta rename it. – Nathan McKaskle Aug 19 '16 at 20:13

0 Answers0