Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install font-awesome in Visual Studio 2017 using ASP.NET Core v2

I am building a webpage using ASP.NET Core v2 and would like to use font-awesome.

First let me say that I have tried several things. like installing Bower from NPM, installing font-awesome from NPM, installing font-awesome from Bower packages in VS but nothing seem to work.

can someone please provide the correct way to install font-awesome, (preferred without using a lot of console commands or manual copying of files.)

This is what my depedencises currently looks like

enter image description here

enter image description here

enter image description here enter image description here

like image 465
Thomas Adrian Avatar asked Mar 29 '18 09:03

Thomas Adrian


People also ask

How do I use font awesome code in Visual Studio?

Command Palette Options Use the Set Icon labels to Class Name command to use the standard class name format. Use the Use FA 5 command to use Font Awesome 5. Use the Use FA 6 command to use Font Awesome 6.


1 Answers

I would recommend using LibMan for this (Short documentation how to use it).

I wrote it manually, bet you could add it through "Add -> Client-Side Library". Here is mine libman.json

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
    "libraries": [
        {
            "library": "[email protected]",
            "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"
            ]
        }
    ]
}
like image 100
Aleksej Vasinov Avatar answered Sep 30 '22 17:09

Aleksej Vasinov