.Net Core + 找不到类型或命名空间 'SelectList'
.Net Core + The type or namespace 'SelectList' could not be found
我在我的模型项目中创建了一个 class,它具有多个属性。其中我有 SelectList,但它太奇怪了,我无法将它包含在我的 class 中。红色下划线表示
The type or namespace "SelectList' could not be found
我尝试包含命名空间
using Microsoft.AspNetCore.Mvc.Rendering;
但是 Mvc 中有一条红色下划线表示
The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore'
有什么问题?
public class Student
{
public SelectList Region { get; set; }
public string FullName { get; set; }
}
已解决。我必须从 Nuget 包管理器
下载 microsoft.aspnetcore.mvc
我在我的模型项目中创建了一个 class,它具有多个属性。其中我有 SelectList,但它太奇怪了,我无法将它包含在我的 class 中。红色下划线表示
The type or namespace "SelectList' could not be found
我尝试包含命名空间
using Microsoft.AspNetCore.Mvc.Rendering;
但是 Mvc 中有一条红色下划线表示
The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore'
有什么问题?
public class Student
{
public SelectList Region { get; set; }
public string FullName { get; set; }
}
已解决。我必须从 Nuget 包管理器
下载 microsoft.aspnetcore.mvc