how can I install package to the wwwroot in mvc core 2 - npm

Recently I Installed the VS 2017 Which Contains Asp.net mvc core 2
but there is a very confusion problems there!
that is how can i Install a new package into the wwwroot so:
_ Im using bower but supporting is end of and can not find out bower.json in the project>> new item after config it using npm . I installed it using npm but still can not find( .bowerrc file under bower.json.) to set the directory:
So-called valid document
_with gulp and grunt : end of supporting gulp too and can not find gulpfile.js in the project>>new Item after configure it using npm
please heeeeeeeeeeeeeeeelp me

You can use Library Manager:
Library Manager (“LibMan” for short) is Visual Studio’s experimental
client-side library acquisition tool. It provides a lightweight,
simple mechanism that helps users find and fetch library files from an
external source (such as CDNJS) and place them in your project.

Related

Template integrate in asp .net 6

I want to integrate a bootswatch theme in my ASP .NET MVC Core project. I am working with Dot net version 6. I can not integrate the template, the background always remains the same in my application. Can anyone suggest to me a proper way to integrate the template?
1. You can run npm init --yes, and install bootswatch with npm command.
2. Copy the node_modules folder, and paste into the wwwroot.
Please include the node_modules folder in your project.
3. Modify the _Layout.cshtml.
Test Result
For more details, you also can follow this video to learn.
Tips: The name in package.json can't same as bootswatch, otherwise you will fail to install bootswatch.

TinyMCE not installing the default scripts

I have created a asp.net core 2.2 web app and I want to integrate TinyMCE in it. I found out that you can download it as a nuget package but when I installed it, the package did not come with the TinyMCE js template folder(It just said that the package was installed and that's it). How can I install TinyMCE properly?
NuGet does not support copying content files to your project directory any more. This was changed when PackageReference was introduced which is the new default and only supported way to include package references in .NET Core projects.
So while TinyMCE still updates the NuGet package, you will only be able to consume it properly in classic non-Core ASP.NET MVC projects on the .NET Framework.
If you want to use TinyMCE in ASP.NET Core, you should look at other mechanisms to include JavaScript dependencies in your application.
When you take a look at TinyMCE’s “Get TinyMCE” page, you will see a few options. If you already have some npm-based deployment set up, then you should probably get it from npm. Otherwise, you can also just download a static release and copy it into your wwwroot directory. This would actuallly have the same effect as using the NuGet package (if that worked).

How to find and use downloaded packages from nuget in vs2017 software (and in an asp.net core project)?

In Visual Studio 2017, I use the following command to install a package like .jQuery.Unobtrusive.Validation:
Install-Package Microsoft.jQuery.Unobtrusive.Validation -Version 3.2.11
And the operation is done successfully.
Now I'm looking for files on wwwroot but can not find anything? what is the problem?
Use LibMan :
In Solution Explorer, right-click the project folder in which the files should be added. Choose Add > Client-Side Library.
Type jquery-validation-unobtrusive#3.2.11 in Library input area .
Click Install , the library will install to target location . The default is wwwroot/lib/jquery-validation-unobtrusive/

How to update client-side packages in ASP .NET Core 2.1?

Environment: .NET Core 2.1 running on Ubuntu 18.04
When a new ASP .NET core project is created, a bunch of client-side packages are automatically generated. For example:
$ dotnet new razor
$ ls wwwrooot/lib
bootstrap jquery jquery-validation jquery-validation-unobtrusive
However, I do not see any configuration file that lists these client-side packages.
I believe bower is no longer being used. Plus, I don't see any bower.json file.
I believe libman is not even present on my machine. Plus, I don't see any libman.json file.
Using the command dotnet restore restores only the .net packages listed in .csproj file but does not restore packages under wwwroot/lib directory.
As a quick test, I deleted wwwroot/lib directory and tried various commands. However, none of my attempts was able to restore any packages under wwwroot/lib directory.
Can someone please tell me how are client-side packages managed in ASP.NET Core 2.1 and beyond? How does one upgrade these packages to the latest version?
Most of the files in projects created with the dotnet new command are simply hard-coded in the template. So if you delete them the only way to get them back would be to copy them in from somewhere else.
If you want to manage client-side libraries, then you can use any number of tools to help you such as LibMan or one of the many third-party alternatives.

ASP.NET vNext with typescript

I have downloaded the Visual studio 2015 RC to test the new ASP.NET vNext. Now I'm trying to build a MVC project with typescript.
I found that in vNext uses the following dependencies (correct me if I'm wrong):
Nuget for backend dependencies
Bower for client-side dependencies
Npm for client-side build dependencies
But who have to fetch definitions for typescript(*.d.ts like jquery.d.ts...)?
From the things I wrote above, it would have to be done by Bower, which does not have any typescript definitions. Similarly, Nuget does not include any typescript definitions that can be added to the project.
TSD Manager is a npm package. However understand your explicit categorization of what tool is used for what dependency doesn't exist. VS 2015 provides some templates but they are just that. Don't like grunt, gulp or bower and want to use a different task runner and package manager well you can use them as well right out of the box (as long as it can be installed by npm). Some web developers just use npm for everything instead of using npm & bower.
To specifically answer your question you can install the TypeScript Manager by adding "tsd": "0.6.3" to your packages.json file and doing a package restore.
But who have to fetch definitions for typescript(*.d.ts like jquery.d.ts...)?
TSD for typescript definitions: https://github.com/DefinitelyTyped/tsd