Not sure how to publish to (the official) nuget server?
Hi hi :)
I'm trying to package and publish a pretty simple nuspec file to the official NuGet servers.
I have a nuspec file created.
I've thought I've
added the correct settings to my yml file:
build:
publish_nuget: true
deploy:
provider: NuGet
api_key:
secure: jfcUvHZhgnUboplqTBDWr8mG5PIlrgBv5TA2fhhop4ZSiDxskyy+RtYyeHoduJFR
and all I get is this...
=== TEST EXECUTION SUMMARY ===
Tests.DLL Total: 35, Errors: 0, Failed: 0, Skipped: 0, Time: 13.172s
Deploying using NuGet provider
No packages were pushed.
Updating build cache
All cache items are up to date.
Build success
1) Is there some trick with how it discovers my
nuspec file?
2) what happens if i have multiple nuspec files (which
I wish to push some or all?)
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac

Support Staff 1 Posted by Feodor Fitsner on 05 Jul, 2015 06:51 PM
Automatic NuGet packaging works with VS projects only (
.nuspecfile should have the same name as.*projfile and be in the same directory).You should use your own command to build the package and push it to artifacts.
Take a look at this project for example: https://github.com/appveyor/secure-file/blob/master/appveyor.yml
2 Posted by Pure Krome on 07 Jul, 2015 09:51 AM
AH! ok - that starts to make more sense.
I couldn't find any documentation about Automatic NuGet packaging and the requirement that the
.nuspecandprojfile need to be the same. Does that exist? If not, want me to make an issue about it?That gist is great! Also - this should be in some doc's again .. if it's not, i can add it to the same issue (or make a new one, etc).
top stuff Feodor!
Support Staff 3 Posted by Feodor Fitsner on 07 Jul, 2015 05:20 PM
There is a short mentioning of that: http://www.appveyor.com/docs/nuget#automatic-publishing-of-nuget-pr...
Regarding the versioning approach based on AssemblyInfo - I'm going to blog about that.
4 Posted by Pure Krome on 08 Jul, 2015 12:30 AM
Ah - yeah .. I've read that before and totally misunderstood the explanation.
For context:
I would probably suggest this be re-written. In fact, this entire page is really (IMO) confusing. When I first landed here, I was hoping to read up about how to publish to NuGet.org. But it starts out talking about a private nuget feed (waa??) and how to access it, etc. IMO, i think this entire page should be split into two parts => publishing to NuGet.org and publishing to private.
Of course - publishing to a nuget feed is identical for either one - official or private ... so there might be double up code-examples in both docs .. but I really think there needs to be a split of the two. Also, some real-life examples for the private feed would be so helpful - why use it? how to use it in an example project, etc... I feel that this functionality is underrated because of lack of understanding (my gut feeling - you would have the stats, though).
Anyways - as to the automatic publishing:
... anyways, i think i've blabbed on enough here :blush:
Support Staff 5 Posted by Feodor Fitsner on 08 Jul, 2015 12:50 AM
Alright, I see what you mean. Thanks for pointing that out. Btw, did you know that anyone can contribute to docs: https://github.com/appveyor/website/blob/master/NJekyll/site/docs/n... :)
6 Posted by Pure Krome on 08 Jul, 2015 01:01 AM
ah kewl! (nope, i didn't know they were forkable)
7 Posted by Pure Krome on 14 Jul, 2015 07:19 AM
Heya Feodor,
as suggested above - I'm trying to manually do my own packing of my nuspecs.
I've been using a powershell script (locally) on all my OSS repo's that does this for me. It basically, looks for all nuspec's, pack's them, then optionally pushes em up to nuget if an api key was given.
I'm trying to do this in a
ymlfile with no luck.here's what i'm trying to do
The ps script is failing. i'm not sure i'm calling it right.
this is what i usually do if i'm in the correct folder, locally on my own dev machine:
.\NuGet Deployment.ps1 -Version 1.2.3-alpha -NuGet c:\temp\NuGet.exethat will create a
nupkgfor everynuspecfile it finds, in the current directory.Any suggestions?
Here's the full file in some OSS repo i have.
Support Staff 8 Posted by Feodor Fitsner on 14 Jul, 2015 02:55 PM
I'd use this to push all nuget packages to artifacts:
Not sure I understand this line:
Are you calling
deployment.ps1to package or it'sNuGet Deployment.ps1with space in it?9 Posted by Pure Krome on 15 Jul, 2015 12:11 AM
I have a powershell script called
NuGet Deployment.ps1. It exists in<root folder>\NuGet Package Specifications\folder.it has a few args:
(and some other args that aren't used for a release deployment in AV.
I'm not sure how to 'run' that ps file using the AV yml syntax.
Support Staff 10 Posted by Feodor Fitsner on 15 Jul, 2015 12:27 AM
Got it.
Try this:
11 Posted by Pure Krome on 15 Jul, 2015 12:47 AM
Nope, not working.
error message:
it's def the PS line... It's like the parser doesn't like the
&char?here's my file...
Support Staff 12 Posted by Feodor Fitsner on 15 Jul, 2015 01:32 AM
OK, this one passes validation:
13 Posted by Pure Krome on 15 Jul, 2015 05:21 AM
yep - passes!
but errors :(
is that error suggesting that I can't ouput my script stuff to the AV console?
Exception calling "SetBufferContents" with "2" argument(s): "The method or operation is not implemented."<-- no idea what that means :(Support Staff 14 Posted by Feodor Fitsner on 15 Jul, 2015 05:24 AM
Most probably it's requesting input and this exception comes from AppVeyor custom PowerShell host.
- Feodor
15 Posted by Pure Krome on 15 Jul, 2015 06:01 AM
So there's no way to get the "inner exception" stuff?
btw, running this on my localhost works fine :/
Support Staff 16 Posted by Feodor Fitsner on 15 Jul, 2015 05:44 PM
This error could be caused by calling a cmdlet with missing parameter or by calling
Read-Host. You can try seeing what's going on via RDP: http://www.appveyor.com/docs/how-to/rdp-to-build-worker17 Posted by Pure Krome on 01 Sep, 2015 12:06 AM
I'm back onto this issue - trying to see if I can resolve it.
Funnily enough, I asked this (similar) question nearly a year ago and created a GitHub issue back then too!
18 Posted by Pure Krome on 01 Sep, 2015 05:04 AM
Another question @feodor - how do I use a custom
secureenvironmental variable in a powershell script?give this script (from above..)
- ps: '& ".\NuGet Package Specifications\NuGet Deployment.ps1" -Version $env:appveyor_build_version -NuGet "C:\Tools\NuGet\nuget.exe"'i wish to add the following powershell cli argument :
-apiKey <my secure variable>19 Posted by Pure Krome on 01 Sep, 2015 06:53 AM
Damn - no luck. So I've RD'd into the VM and fixed my PS bugs. sweet.
Go back to AV and run the script and still get that weird error.
here's proof...
(note: i'll change my API key later once this works) (note 2: i'm hardcoding things right now to get this to work).
and here's 2 screenies showing you that it works when i RD in ....
Any help Feodor?
Support Staff 20 Posted by Feodor Fitsner on 01 Sep, 2015 06:58 AM
I think it should be like "-apiKey $env:my_secure_variable". Also note that secure variables are not set on PR builds.
- Feodor
21 Posted by Pure Krome on 01 Sep, 2015 09:05 AM
In my example above, I hardcoded the variables just to get this working. And it's still not.
The code is all OSS so you should be able see the build history and even try it yourself (by adding the RD lines to the yml script) (take note the code above is for a specific branch).
it's really confusing/frustrating :(
Support Staff 22 Posted by Feodor Fitsner on 01 Sep, 2015 09:20 AM
Sure, will take a look. What AV project URL is that?
23 Posted by Pure Krome on 01 Sep, 2015 10:57 AM
is this the URL? https://ci.appveyor.com/project/PureKrome/openrealestate-net-bk69y
Support Staff 24 Posted by Feodor Fitsner on 01 Sep, 2015 11:08 AM
Yeah, right.
- Feodor
Support Staff 25 Posted by Feodor Fitsner on 01 Sep, 2015 04:30 PM
This `cls` command is an issue: https://github.com/OpenRealEstate/OpenRealEstate.NET/blob/feature/appveyor-yml/NuGet/NuGet%20Package%20and%20Package.ps1#L202 - remove it and it should be fine.
26 Posted by Pure Krome on 02 Sep, 2015 01:40 AM
Oh wow! works! that was it. You're awesome Feodor! thank you so much!
Pure Krome closed this discussion on 02 Sep, 2015 01:40 AM.
Pure Krome re-opened this discussion on 02 Sep, 2015 01:41 AM
27 Posted by ThanksFeodor on 19 Dec, 2016 08:26 PM
Thanks Feodor!
Found this via the searching the "2" argument(s) exception message in a not directly related context and you saved me lots of time.
Pure Krome closed this discussion on 19 Dec, 2016 11:43 PM.