Dotnet nuget push insecure local feed
Hello,
I try to use the dotnet nuget push command to publish artifacts nuget in the local Teamcity nuget feed. The dotnet version used is dotnet 9.
The nuget feed is under unsecure http as the server is local only. And following the recent changes of .Net 9 (It's not possible to push to HTTP sources specified via command line · Issue #14047 · NuGet/Home) I'm unable to find a way to get this nuget push working.
Indeed I've added a new source in the global nuget config but I do not find how to reference it in TeamCity as the source package is the custom TeamCity variable : %teamcity.nuget.feed.httpAuth.KryptonComponents.localTeamCity.v2%
The build log :
dotnet nuget push
21:32:40 Starting: .NET SDK 9.0.203 "C:\Program Files\dotnet\dotnet.exe" nuget push C:\TeamCity\buildAgent\work\bb67bbd596ec731c\bibi\ComponentFactory.Krypton.Docking.4.4.1.nupkg --api-key ******* --source http://localhost:<myport>/httpAuth/app/nuget/feed/KryptonComponents/localTeamCity/v2 --force-english-output
21:32:40 in directory: C:\TeamCity\buildAgent\work\bb67bbd596ec731c
21:32:40 You are running the 'push' operation with an 'HTTP' source: http://localhost:<myport>/httpAuth/app/nuget/feed/KryptonComponents/localTeamCity/v2. NuGet requires HTTPS sources. To use an HTTP source, you must explicitly set 'allowInsecureConnections' to true in your NuGet.Config file. Refer to https://aka.ms/nuget-https-everywhere for more information. (Step: Dotnet Nuget Push (.NET))
21:32:40 Process exited with code 1
21:32:40 Process exited with code 1 (Step: Dotnet Nuget Push (.NET))
21:32:40 Step Dotnet Nuget Push (.NET) failed
Nuget.config :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="localTeamCity" value="http://localhost:<myport>/httpAuth/app/nuget/feed/KryptonComponents/release/v3/index.json" allowInsecureConnections="True" />
</packageSources>
</configuration>
If I specifiy a source in command in the command line parameters : --source localTeamCity, I get :
Option '--source' expects a single argument but 2 were provided.
Specify --help for a list of available options and commands.
Unexpected value 'localTeamCity' for option 'source' (Step: Dotnet Nuget Push (.NET))
Thanks for the help !
Please sign in to leave a comment.
Instead of using the .NET runner, you may consider using the NuGet Publish runner: https://www.jetbrains.com/help/teamcity/nuget-publish.html
Additionally, TeamCity supports serving NuGet feeds over HTTPS. For more information on enabling HTTPS in your TeamCity server, please refer to: https://www.jetbrains.com/help/teamcity/https-server-settings.html
Best Regards,
Tom