tag:help.appveyor.com,2012-11-13:/discussions/questions/44202-how-to-publish-symbol-packages-snupkg-on-nugetAppVeyor: Discussion 2020-07-14T21:02:59Ztag:help.appveyor.com,2012-11-13:Comment/478791162019-11-28T00:23:01Z2019-11-28T00:23:04ZHow to publish symbol packages (snupkg) on NuGet?<div><p>I'm trying to publish my symbol packages (.snupkg) on NuGet but only the regular packages (.nupkg) are published.</p>
<p>Here's my configuration:</p>
<pre>
<code>version: '#{build}'
image: Ubuntu
configuration: Release
nuget:
disable_publish_on_pr: true
before_build:
- ps: dotnet restore
build:
project: DbContextValidation.sln
publish_nuget: true
publish_nuget_symbols: true
use_snupkg_format: true
parallel: true
verbosity: minimal
deploy:
- provider: NuGet
api_key:
secure: […]</code>
</pre>
<p>The snupkg files are correctly produced: <a href="https://ci.appveyor.com/project/0xced/dbcontextvalidation/builds/29171762#L72">https://ci.appveyor.com/project/0xced/dbcontextvalidation/builds/29...</a><br></p>
<pre>
<code>Successfully created package '/tmp/7r14awoe18/DbContextValidation.EF6.1.0.0-preview.0.255.nupkg'
Successfully created package '/tmp/7r14awoe18/DbContextValidation.EF6.1.0.0-preview.0.255.snupkg'
[…]
Successfully created package '/tmp/pqetj7sp0q/DbContextValidation.EFCore.1.0.0-preview.0.255.nupkg'.
Successfully created package '/tmp/pqetj7sp0q/DbContextValidation.EFCore.1.0.0-preview.0.255.snupkg'.</code>
</pre>
<p>But only nupkg files end up in the artifacts: <a href="https://ci.appveyor.com/project/0xced/dbcontextvalidation/builds/29171762/artifacts">https://ci.appveyor.com/project/0xced/dbcontextvalidation/builds/29...</a></p>
<p>What am I missing?</p></div>0xcedtag:help.appveyor.com,2012-11-13:Comment/478791162019-11-28T00:46:16Z2019-11-28T00:46:16ZHow to publish symbol packages (snupkg) on NuGet?<div><p>Thanks for reporting that issue! It looks like it's not yet implemented for Linux/macOS builds. I've created a new issue to fix that and deploy during the next image update: <a href="https://github.com/appveyor/ci/issues/3224">https://github.com/appveyor/ci/issues/3224</a></p>
<p>For now you should use a workaround, like calling <code>dotnet pack</code> explicitly with known output directory and then publishing files from output directory to artifacts. Let me know if you need an example.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/478791162019-11-28T01:03:05Z2019-11-28T01:03:05ZHow to publish symbol packages (snupkg) on NuGet?<div><p>Thanks for your quick reply! I added this in after_build:<br></p>
<pre>
<code>Get-ChildItem /tmp/*/DbContextValidation.*.snupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }</code>
</pre>
It's working, I have now 4 artifacts instead of 2:<br>
<pre>
<code>Uploading artifact DbContextValidation.EF6.1.0.0-preview.0.255.snupkg (4458 bytes)...100%
Uploading artifact DbContextValidation.EFCore.1.0.0-preview.0.255.snupkg (4632 bytes)…100%</code>
</pre>
<p>But the snupkg files are not published to NuGet: <a href="https://ci.appveyor.com/project/0xced/dbcontextvalidation#L117">https://ci.appveyor.com/project/0xced/dbcontextvalidation#L117</a><br></p>
<pre>
<code>Deploying artifacts using NuGet provider
Publishing DbContextValidation.EF6.1.0.0-preview.0.255.nupkg to https://www.nuget.org...Skipped (A package with ID 'DbContextValidation.EF6' and version '1.0.0-preview.0.255' already exists and cannot be modified.)
Publishing DbContextValidation.EFCore.1.0.0-preview.0.255.nupkg to https://www.nuget.org...Skipped (A package with ID 'DbContextValidation.EFCore' and version '1.0.0-preview.0.255' already exists and cannot be modified.)
No packages were pushed.
Build completed</code>
</pre></div>0xcedtag:help.appveyor.com,2012-11-13:Comment/478791162019-11-28T01:17:47Z2019-11-28T01:17:47ZHow to publish symbol packages (snupkg) on NuGet?<div><p>Add <code>-Type</code> to <code>Push-AppVeyorArtifact</code> command:</p>
<pre>
<code>Push-AppveyorArtifact $_.FullName -FileName $_.Name -Type NuGetPackage</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/478791162019-11-29T20:58:16Z2019-11-29T20:58:16ZHow to publish symbol packages (snupkg) on NuGet?<div><p>It worked perfectly, thanks!</p></div>0xcedtag:help.appveyor.com,2012-11-13:Comment/478791162020-05-14T12:39:56Z2020-05-14T12:39:56ZHow to publish symbol packages (snupkg) on NuGet?<div><p>I see that <a href="https://github.com/appveyor/ci/issues/3224">issue #3224</a> is now closed but I'm still having trouble to publish the snupkg on NuGet on an Ubuntu image.</p>
<p>Here are the relevant parts of my configuration:</p>
<pre>
<code>image: Ubuntu
build:
project: DockerRunner.sln
publish_nuget: true
publish_nuget_symbols: true
use_snupkg_format: true
parallel: true
verbosity: minimal
deploy:
on:
branch: deploy</code>
</pre>
<p>Publishing of the <code>nupgk</code> file works but <a href="https://ci.appveyor.com/project/0xced/dockerrunner/builds/32873575">publishing of the <code>snupkg</code> file fails</a> with a <em>Method Not Allowed</em> error:</p>
<pre>
<code>Deploying artifacts using NuGet provider
Publishing DockerRunner.0.9.0-alpha.0.2.nupkg to https://www.nuget.org...OK
Publishing DockerRunner.0.9.0-alpha.0.2.snupkg to https://nuget.smbsrc.net...
Error publishing package. NuGet server returned 405: Method Not Allowed</code>
</pre></div>0xcedtag:help.appveyor.com,2012-11-13:Comment/478791162020-05-14T17:09:39Z2020-05-14T17:09:39ZHow to publish symbol packages (snupkg) on NuGet?<div><p>Thanks for reporting that! Sounds like a bug. Will be fixed this week, please subscribe to the issue: <a href="https://github.com/appveyor/ci/issues/3431">https://github.com/appveyor/ci/issues/3431</a></p></div>Feodor Fitsner