Model view controller “ASP.NET核心MVC”;命名空间不能直接包含字段或方法之类的成员;创建新类时

Model view controller “ASP.NET核心MVC”;命名空间不能直接包含字段或方法之类的成员;创建新类时,model-view-controller,asp.net-core,Model View Controller,Asp.net Core,我创建了一个新的ASP.NET核心项目,创建了一个文件夹ViewModels,并在其中创建了一个空类: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace 10k.ViewModels { } 我马上在名称空间下看到一条红色的曲线,上面写着 "A namespace cannot directly contain members s

我创建了一个新的ASP.NET核心项目,创建了一个文件夹ViewModels,并在其中创建了一个空类:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace 10k.ViewModels
{
}
我马上在名称空间下看到一条红色的曲线,上面写着

"A namespace cannot directly contain members such as fields or methods". 

知道为什么会发生这种情况吗?

名称空间必须以字母开头。如果将10k改为TenK,应该可以使用。

尝试重命名名称空间-名称空间名称不能以C中的数字开头#

如果您试图运行此操作,则应该会出现编译器错误


谢谢!让我一天都很愉快