question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot publishing a NuGet to TFS 2017

See original GitHub issue

When I try to publish a NuGet to my TFS 2017 on-premises using a build step, I get following error messages:

2016-12-21T09:33:58.3510841Z [command]C:\Windows\system32\chcp.com 65001
2016-12-21T09:33:58.3667084Z Active code page: 65001
2016-12-21T09:34:00.7730379Z Detected NuGet version 3.3.0.212 / 3.3.0
2016-12-21T09:34:00.7730379Z SYSTEMVSSCONNECTION exists true
2016-12-21T09:34:00.7886681Z [command]C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe push -NonInteractive C:\Agent\_work\1\s\Foo.1.4.3-build-20161221-1.nupkg -Source http://myServer:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json -ApiKey VSTS -Verbosity Detailed
2016-12-21T09:34:01.4761938Z Please provide credentials for: http://myserver:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json
2016-12-21T09:34:01.4761938Z UserName: System.InvalidOperationException: Cannot prompt for input in non-interactive mode.
2016-12-21T09:34:01.5074440Z ##[error]Error: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
2016-12-21T09:34:01.5074440Z ##[error]Packages failed to publish
I have also try to run the NuGet.exe push ... command from a PowerShell script as a build step, and that also failed.

When I run it manually in a ordinary PowerShell console, it works without problems.

What is the runtime difference between running it from console compared to running it in a build step? How do I make it works?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zjrunnercommented, Dec 22, 2016

holiday delays, sorry – You are past the auth issues on the client now, where nuget couldn’t even find the creds to send to the server. Now you are sending them to the server properly but it looks like an authn/authz issue since you’re getting a 401.

Head to one of your projects and click the ‘Packaging’ link in the Build & Release header item to get over to your feeds. Right click & Edit (or use the pencil icon) for your feed and go to the permissions. Ensure you have at least read permissions (you’ll need Contribute if you’re doing a push here) for “Project Collection Build Service (YourProject)”. This is generally the issue – setting it up from another project or removing permissions when narrowing down contributors.

1reaction
zjrunnercommented, Dec 21, 2016

Looks like you are using nuget 3.3 from those logs. You need to use nuget 3.5 or higher to use the TFS Packaging feature due to some auth fixes that went into 3.5. You’ll find the version toggle inside the Nuget task options in your build definition. We weren’t able to just make it the default for everyone because of some breaking changes between 3.3 and 3.5 that would have impacted everyone using nuget tasks but not yet using TFS packaging (and no ability to set a good default only for new build definitions). Please verify.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot publishing a NuGet to TFS 2017 · Issue #3287 - GitHub
When I try to publish a NuGet to my TFS 2017 on-premises using a build step, I get following error messages: 2016-12-21T09:33:58.3510841Z ...
Read more >
Cannot publishing a NuGet to TFS 2017 - Stack Overflow
Open Command Prompt and navigate to Nuget.exe folder (CD); Update package source through this command (Do not include quotes to user name and ......
Read more >
TFS 2017 build nuget publisher error 403
I have a TFS build using the nuget task for publisher. 1. I can't find specific documentation how to use the version I...
Read more >
TFS 2017 NuGet publisher task fails with 401 - Unauthorized ...
TFS 2017 NuGet publisher task fails with 401 - Unauthorized exception. With TFS 2017, we have added the new Package Management feature, which ......
Read more >
Package Management with Azure Artifacts - Azure DevOps Labs
Visual Studio 2017 or later. This lab requires you to complete tasks 1 and 2 from the ... Task 2: Creating and publishing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found