1

I try to create nuget package from my netstandard 2.1.Package was created successfully and my conect files also include in package folder.

enter image description here

But my problem is When i try to install this package into my client web application, content folder and files and files are included into project wwwroot folder, But all css and js are not physically downloaded in to project solution.

enter image description here

My csproj file look like below

<Project Sdk="Microsoft.NET.Sdk">  
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <PackageTags>Lsc.Logistics.HtmlHelpers.Core</PackageTags>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
    <Version>1.0.0.9-preview0102</Version>
    <Company>Company Name</Company>
    <Authors>Company Owner</Authors>
    <Description>COmmonJs and cssr</Description> 
    <FileVersion>1.0.0.0</FileVersion>
    <PackageOutputPath>D:\ThemeRelease\PackageCore</PackageOutputPath>
    <ContentTargetFolders>contentFiles\any\any\</ContentTargetFolders>
  </PropertyGroup>
  <ItemGroup>
    <Content Include="wwwroot\**\*.*" Label="Packaging">
      <Pack>true</Pack>
      <PackageCopyToOutput>true</PackageCopyToOutput>
    </Content>
  </ItemGroup>
</Project>

What I need to do, to download css and js file, When user install my package

P John Raj
  • 537
  • 1
  • 4
  • 17

1 Answers1

1

If you nuget package contains css and js file.It is a client-side library. For client library,when you install the nuget package,it would not shown in your project.It would exist in %UserProfile%\.nuget\package by default.

Microsoft produce a lightweight, effective solution for web developers to easily manage common client-side library files——Libman.

If your package is not provided by official csdn,you could specify the library's location like below:

  1. Choose the Provider(filesystem)
  2. Choose the library's location
  3. Type the Target location

enter image description here

  1. Click Install button and it would generate the following code in libman.json like below:

    {
      "version": "1.0",
      "defaultProvider": "cdnjs",
      "libraries": [
        {
          "provider": "filesystem",
          "library": "C:\\Users\\XXX\\XX\\",
          "destination": "wwwroot/lib/Chart/Content/"
        },
        ...
      ] 
    }
    

Reference:

Rena
  • 30,832
  • 6
  • 37
  • 72
  • I try above, I hope its a write solution, now facing below problem content css theme blue ( bluetheme.css, bluetheme.min.css) default ( default.css, default.min.css) Now I can selecting path path //<.nuget>//packageName//content// Its Not showing all sub folder and its files But if refer path //<.nuget>//packageName//content// Theme//Blue Then I can select all files under blue folder How to solve this one How to create file system package – P John Raj Dec 27 '19 at 10:10