Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NU5017 reported for symbol packages without clarifying this #10372

Open
AArnott opened this issue Dec 9, 2020 · 5 comments
Open

NU5017 reported for symbol packages without clarifying this #10372

AArnott opened this issue Dec 9, 2020 · 5 comments
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Functionality:Pack Priority:2 Issues for the current backlog. Type:Bug

Comments

@AArnott
Copy link
Contributor

AArnott commented Dec 9, 2020

When this property is set (perhaps in a Directory.Build.props file somewhere):

    <SymbolPackageFormat>snupkg</SymbolPackageFormat>

NuGet packages that only bundle content, build imports, etc. fail to pack in a somewhat bizarre way:

  Microsoft.VisualStudio.SDK.VsixSuppression -> D:\git\VSIXSuppression\bin\Microsoft.VisualStudio.SDK.VsixSuppression\Debug\netstandard2.0\Microsoft.VisualStudio.SDK.VsixSuppression.dll
  Successfully created package 'D:\git\VSIXSuppression\bin\Packages\Debug\NuGet\Microsoft.VisualStudio.SDK.VsixSuppression.16.8.0-gfab5d5df6a.nupkg'.
C:\Program Files\dotnet\sdk\5.0.100\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(207,5): error NU5017: Cannot create a package that has no dependencies nor content. [D:\git\VSIXSuppression\src\Microsoft.VisualStudio.SDK.VsixSuppression\Microsoft.VisualStudio.SDK.VsixSuppression.csproj]

Build FAILED.

Note it says it packed, then reports errors and breaks the build. No clue as to why.

Eventually I figure out that it's the symbols package that failed to build. It doesn't apply in my case, so I can remove the property that says to build a snupkg file. But it would sure save a lot of investigation time if the error message indicated that it was the symbols package that failed and that the property can be cleared to solve the problem.

Similar to what @Zastai posted in #8583 (comment)_

@kartheekp-ms kartheekp-ms added Functionality:Pack Area:ErrorHandling warnings and errors/log messages & related error codes. labels Dec 9, 2020
@Zastai
Copy link

Zastai commented Dec 9, 2020

In fact, it is exactly my case - I had missed that the base package had been created. And I didn't consider that possiblity because I had not explicitly requested a symbols package.

With a pack operation creating two packages it would indeed be useful if the error message included the target package name.

@mhutch
Copy link

mhutch commented May 12, 2021

I'm running into this problem with PdbType=embedded. I have not set SymbolPackageFormat, and neither IncludeSmbols=false nor NoPackageAnalysis=true can be used to suppress it.

While my issue would be fixed by dotnet/msbuild#2754, the symptom is the same as this one - the exact same misleading error that cannot be suppressed.

@AArnott
Copy link
Contributor Author

AArnott commented May 12, 2021

Yes, I recently started building embedded pdbs as well (only on dev boxes) and it took a while to figure out why packing started failing on dev boxes so I could fix it because again, this misleading error cost me time going down the wrong path.

@dmstrat
Copy link

dmstrat commented Feb 26, 2024

Came across this because I had the same problem. Error message could be better based on my experience here:

  1. have the DebugType=embedded and SymbolPackageFormat=snupkg -> get error stated
  2. remove express SymbolPackageFormat node from csproj -> error disappears, but legacy package (*.symbols.nupkg) created without exception/error.

Seems legacy package creation handles the fact that the pdb information is packed into the nupkg, but snupkg package exceptions under same conditions.

@yugabe
Copy link

yugabe commented Sep 9, 2024

I had a pretty complex setup that broke on CI/CD because of this as well. I couldn't figure out why wouldn't the package build; when in fact, it does (and it did), but couldn't create a symbol package after the fact - exactly because there were no symbols to embed the sources in, and the snupkg package would've been empty. I'm not sure what the expected behavior be, the message is definitely misleading, but I think if the snupkg can't build because it would be empty, maybe it's intentional?

<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>false</IncludeSymbols>

should not even try to create a symbols package, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:ErrorHandling warnings and errors/log messages & related error codes. Functionality:Pack Priority:2 Issues for the current backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

9 participants