asp.net-mvc - 如何使用 ASP.NET Core v2 在 Visual Studio 2017 中安装 font-awesome

标签 asp.net-mvc npm visual-studio-2017 bower font-awesome

我正在使用 ASP.NET Core v2 构建一个网页,并且想要使用 font-awesome。

首先我要说的是我已经尝试了几件事。比如从 NPM 安装 Bower、从 NPM 安装 font-awesome、从 VS 中的 Bower 包安装 font-awesome,但似乎没有任何效果。

有人可以提供安装 font-awesome 的正确方法吗(最好不要使用大量控制台命令或手动复制文件。)

这就是我的依赖目前的样子

enter image description here

enter image description here

enter image description here enter image description here

最佳答案

我建议使用 LibMan 来实现此目的 ( Short documentation how to use it )。

我手动编写的,我打赌你可以通过“添加 -> 客户端库”添加它。这是我的 libman.json

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
    "libraries": [
        {
            "library": "font-awesome@4.7.0",
            "destination": "wwwroot/lib/font-awesome",
            "files": [
                "css/font-awesome.min.css",
                "fonts/fontawesome-webfont.eot",
                "fonts/fontawesome-webfont.svg",
                "fonts/fontawesome-webfont.ttf",
                "fonts/fontawesome-webfont.woff",
                "fonts/fontawesome-webfont.woff2",
                "fonts/FontAwesome.otf"
            ]
        }
    ]
}

关于asp.net-mvc - 如何使用 ASP.NET Core v2 在 Visual Studio 2017 中安装 font-awesome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49552235/

相关文章:

c# - Asp.net MVC 中的部分 View 有什么意义

c# - 发现多个 Controller 类型与 mvc 应用程序中的 URL 匹配

node.js - 在 Visual Studio Code 中调试 Electron 应用程序

asp.net-mvc - 在 ASP.NET MVC 应用程序中实现粒度安全(即授权)的最佳机制是什么?

node.js - 在 docker 容器上运行 nodejs 应用程序会给出 "Error: Cannot find module '/usr/src/app/nodemon' "

reactjs - 平台 "win32"与此模块不兼容 (fsevents)

visual-studio-2017 - 为什么 Visual Studio 2017 无法为 Swagger Petstore 生成 REST API 客户端?

.net - Visual Studio 2017 中的安装项目缺少 vs_setup.msi?

mysql - 将 SQL 查询结果从 Microsoft Visual Studio 导出到文本文件

asp.net-mvc - ABP Suite 似乎正在生成无法编译的代码