No way to include text files in package using dotnet pack command
See original GitHub issueSteps to reproduce
put the following text in project.json:
“buildOptions”: { “copyToOutput”: [ “MyOwnTextFile.config” ] },
run dotnet pack
Expected behavior
nupkg contains “MyOwnTextFile.config” file
Actual behavior
nupkg does not contain “MyOwnTextFile.config” file
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview2-003121)
Product Information: Version: 1.0.0-preview2-003121 Commit SHA-1 hash: 1e9d529bc5
Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
No way to include text files in package using dotnet pack ...
Now it has correct place in package. But how to tell that this file should be placed in project and copied on build...
Read more >How do I include a text file alongside my class library in ...
Bar.csproj file with the following content: ... you right click the project and select Pack (or if you run dotnet pack from the...
Read more >dotnet pack command - .NET CLI
The dotnet pack command builds the project and creates NuGet packages. The result of this command is a NuGet package (that is, a...
Read more >Dotnet pack - include referenced projects
Shows how to workaround the current limitations of dotnet pack when referencing other projects.
Read more >Copy NuGet Content Files to Output Directory on Build
After reproducing the issue, I narrowed it down to a problem copying template files to the project output directory on build. Because the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nice! Now it has correct place in package.
But how to tell that this file should be placed in project and copied on build to output?
In other words setup “contentFiles”:
https://docs.nuget.org/create/nuspec-reference#contentfiles-with-visual-studio-2015-update-1-and-later
You should use
packOptions
, notbuildOptions
.