Asp.net 无法使用quick fix导入名称空间(Visual Studio代码)

Asp.net 无法使用quick fix导入名称空间(Visual Studio代码),asp.net,visual-studio,asp.net-web-api,visual-studio-code,asp.net-core-2.0,Asp.net,Visual Studio,Asp.net Web Api,Visual Studio Code,Asp.net Core 2.0,大家好,, 我的visual studio代码有问题。最初,当我安装扩展并使用Visual Studio代码时,如果我没有引用名称空间,名称下会有一条红线,并且会有一个黄色灯泡(快速修复)建议我使用etc导入名称空间。但是,它不再这样做了。过去,字段名顶部有大量引用,例如,公共int Id{get;set;}等顶部有1个引用。我曾尝试再次安装扩展,但似乎无法解决问题。有人知道我是怎么解决的吗?多谢各位 using System.Collections.Generic; using System.

大家好,, 我的visual studio代码有问题。最初,当我安装扩展并使用Visual Studio代码时,如果我没有引用名称空间,名称下会有一条红线,并且会有一个黄色灯泡(快速修复)建议我使用etc导入名称空间。但是,它不再这样做了。过去,字段名顶部有大量引用,例如,公共int Id{get;set;}等顶部有1个引用。我曾尝试再次安装扩展,但似乎无法解决问题。有人知道我是怎么解决的吗?多谢各位

using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;

namespace vega.Models
{
    public class Make
    {
        public int Id { get; set; } 

        [Required]
        [StringLength(255)]
        public string Name { get; set; }

        public ICollection<Model> Models { get; set; }

        public Make()
        {
            Models = new Collection<Model>();
        }
    }
}
使用System.Collections.Generic;
使用System.Collections.ObjectModel;
使用System.ComponentModel.DataAnnotations;
名称空间vega.Models
{
公开课制作
{
公共int Id{get;set;}
[必需]
[StringLength(255)]
公共字符串名称{get;set;}
公共ICollection模型{get;set;}
公共物品
{
模型=新集合();
}
}
}

似乎在Visual Studio代码中禁用了CodeLens

可以通过“工具”下的“选项”菜单项在Visual Studio中启用它。
在选项屏幕中,转到文本编辑器-所有语言-编码镜头并在那里启用它。

不客气。别忘了把这篇文章标为好答案。