如何解决ASP.NET Core 3.1找不到类型或名称空间名称DataTable我怎样才能解决这个问题?
我通过命令行向我的Datatables.AspNetCore.Mvc
Web应用程序中添加了Asp.Net Core 3.1
引用,并在我的@using Datatables.AspNetCore.Mvc
文件中添加了_ViewImports.cshtml
语句。当我启动应用程序时,出现此错误:
The type or namespace name DataTablescould not be found. One or more (one or more compilation references may be missing?)
这是我的项目.csproj
文件:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DataTables.AspNetCore.Mvc" Version="1.4.2"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
<PackageReference Include="MySqlConnector" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BSRCore.Database\BSRCore.Database.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\img\" />
</ItemGroup>
</Project>
这是我的_ViewImports.cshtml
文件
@using BSRCore.Models
@using BSRCore.Statics
@using DataTables.AspNetCore.Mvc
@addTagHelper *,Microsoft.AspNetCore.Mvc.TagHelpers
这是我的Index.cshtml
文件
@{
Layout="~/Views/Layouts/_MainLayout.cshtml";
}
@(Html
.Ext()
.Grid<dynamic>()
.Name("grd-customers")
.ServerSide(true)
.DataSource(ds=> ds.Ajax()
.Url("/Customer/GetCustomers")
.Method("GET")))
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。