无法将库从Node_Modules导入ASP.NET CORE APP [英] Cannot import libraries from Node_Modules to ASP.NET CORE APP
问题描述
我正在从Pluralsight学习Scott Allen-ASP.Net核心基础课程,并尝试将Node_Modules的外部库添加到我的项目中.
I'm learning Scott Allen - ASP.Net Core Fundamental course from Pluralsight and trying to add the external library from Node_Modules to my project.
这是项目的结构:
以及如何将数据表库包含到我的项目中(添加到Pages/Shared/_Layout.cshtml)
但是当应用程序运行时,找不到以下库:
问题:
- 这种方式有什么问题?
- 你们能建议一些将外部库导入ASP.NET CORE应用程序的有效方法吗?
我正在使用.NET 5
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
推荐答案
请注意,我们存储静态文件的默认目录为 {content root}/wwwroot
,您可以将与这些datatables插件相关的内容js& css文件到Web根目录.
Please note that the default directory that we store static files is {content root}/wwwroot
, you can move these datatables plugin related js&css files to web root directory.
有关在ASP.NET Core中提供静态文件的更多信息,请查看以下文档:
For more information about serving static files in ASP.NET Core, please check this doc:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view = aspnetcore-5.0
这篇关于无法将库从Node_Modules导入ASP.NET CORE APP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!