NuGet/Home

PackTask quietly doesn't include files with nuspec extension in nupkg

已關閉

#8,637 建立於 2019年9月27日

 (4 則留言) (1 個反應) (0 位負責人)HTML (292 個分叉)batch import
Area:LoggingFunctionality:PackIcebox cleanup candidatePriority:3Product:NuGet.exeProduct:dotnet.exeStatus:Inactivehelp wanted

倉庫指標

星標
 (1,459 顆星)
PR 合併指標
 (平均合併 464天 23小時) (30 天內合併 1 個 PR)

描述

Details about Problem

NuGet product used:

#> dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100\

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
[...]
  3.0.100 [C:\Program Files\dotnet\sdk]

NuGet version: 5.3.0-rtm.6251+b75150f2f4127a77a166c9552845e86fb24a3282.b75150f2f4127a77a166c9552845e86fb24a3282

Worked before: Unknown.

Detailed repro steps

  1. Extract minimal repro project based on dotnet new classlib: PackNuspecContent.zip.

  2. dotnet pack

  3. Open obj\Debug\PackNuspecContent.1.0.0.nuspec, see the File items including a .nuspec:

    <file src="D:\temp\PackNuspecContent\targets\foo.nuspec" target="targets\foo.nuspec" />
    <file src="D:\temp\PackNuspecContent\targets\foo.nuspec.txt" target="targets\foo.nuspec.txt" />
    <file src="D:\temp\PackNuspecContent\targets\foo.txt" target="targets\foo.txt" />
    
  4. Open bin\Debug\PackNuspecContent.1.0.0.nupkg, open targets/, see that the .nuspec isn't included:

    ├───targets
    │       foo.nuspec.txt
    │       foo.txt
    

Other

My goal was to include a nuspec file in an MSBuild SDK tool package that the consuming project will use with nuget.exe pack. I don't think I'm blocked by this issue, but it's pretty surprising and took a bit to spot what was happening. 😄

貢獻者指南