【问题标题】:.Net Core + The type or namespace 'SelectList' could not be found.Net Core + 找不到类型或命名空间“SelectList”
【发布时间】:2017-06-10 01:29:38
【问题描述】:

我在我的模型项目中创建了一个具有多个属性的类。其中我有SelectList,但它太奇怪了,我不能把它包括在我的课堂上。有一条红色下划线表示

找不到类型或命名空间“SelectList”

我已经尝试包含命名空间

使用 Microsoft.AspNetCore.Mvc.Rendering;

但 Mvc 中有一条红色下划线表示

命名空间“Microsoft.AspNetCore”中不存在类型或命名空间名称“Mvc”

有什么问题?

public class Student
{    
    public SelectList Region { get; set; }      
    public string FullName { get; set; }        
}

【问题讨论】:

    标签: namespaces selectlist asp.net-core-1.1


    【解决方案1】:

    解决了。我必须从 Nuget 包管理器下载 microsoft.aspnetcore.mvc

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-04
      • 1970-01-01
      • 1970-01-01
      • 2013-03-25
      相关资源
      最近更新 更多