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

Use credentials provider with VS / MSBuild build steps #28

Open
pjt33 opened this issue May 26, 2020 · 1 comment
Open

Use credentials provider with VS / MSBuild build steps #28

pjt33 opened this issue May 26, 2020 · 1 comment

Comments

@pjt33
Copy link

pjt33 commented May 26, 2020

https://www.jetbrains.com/help/teamcity/using-teamcity-as-nuget-feed.html says

You can use TeamCity NuGet feeds to restore packages in your builds: when the NuGet Installer or NuGet Publish build step is used, TeamCity will use the credentials provider to automatically authenticate requests to the private TeamCity NuGet feeds.

This appears to be literally true: the credentials provider is used automatically with NuGet Installer build steps. But if you instead have a VS or an MSBuild build step with Restore among the targets, the credentials provider does not appear to be used unless you explicitly add a "NuGet feed credentials" build feature to the project.

It would be useful to have the credentials provider applied automatically regardless of the choice of build step, or at least to have a global configuration parameter to enable this.


Cross-reference: JetBrains/teamcity-documentation#62

@pjt33
Copy link
Author

pjt33 commented Jun 4, 2020

I'm told this is a bug, not a missing feature.

When I tried this by just adding the feed to NuGet.config and using the existing build configuration, the step

Runner type: Visual Studio (sln) (Microsoft Visual Studio solution (.sln) runner)
Execute: If all previous steps finished successfully
Solution file path: PROJECT.sln
Working directory: same as checkout directory
Visual Studio: Microsoft Visual Studio 2019
Targets: Restore,Rebuild,Android\PROJECT_FRONTEND:PackageForAndroid
Configuration: Release
Platform: default
Command line parameters: -verbosity:normal

failed with error message:

[RestoreTask] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(124, 5): No se puede cargar el índice de servicio para el origen http://SERVER:8000/httpAuth/app/nuget/feed/PROJECT/FEED/v3/index.json.
El código de estado de la respuesta no indica un resultado correcto: 401 ().

I initially solved the problem by adding a "NuGet feed credentials" build feature for the listed feed, and then after re-reading the documentation I disabled the build feature and split the build step into one "Nuget Installer" step and the existing "Visual Studio (sln)" step without the Restore target. Both of these workarounds were successful.

@pjt33 pjt33 changed the title Feature request: use credentials provider with VS / MSBuild build steps Use credentials provider with VS / MSBuild build steps Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant