Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

MSBuild pack nuget package with files from folder

$
0
0

I have a project which produces a library and then a post build script creates a needed license file. Afterwards, all files needed are copied into one folder (MyFolder) in a different project. This project's single purpose is to pack all the files and subdirectories in "MyFolder" and pack it into a nuget package. The whole content of "MyFolder" should be unpacked in the root directory.

My .csproj looks like this:

<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><OutputType>Library</OutputType><TargetFramework>net6.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><GeneratePackageOnBuild>True</GeneratePackageOnBuild><PackageId>SomeId</PackageId><Company>MyCompany</Company><Product>MyProduct</Product><Version>1.0.0</Version></PropertyGroup><ItemGroup><Content Include="MyFolder\**" PackageCopyToOutput="true"><Pack>true</Pack><PackagePath>\content</PackagePath></Content></ItemGroup></Project>

When I run the pack command, the nuget package is created and all the files appear in the package in the "Content" folder. But, when I install the nuget package, the subdirectories and the license file are not unpacked to the root folder. How can I achieve that?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>