0
votes

I'm attempting to set up my TeamCity instance as a private NuGet package feed. I have successfully configured the feed and set up a build that publishes artifacts.

However, I'm running into a problem when attempting to install a package in my source code from the TeamCity feed:

By going to the "NuGet Feed" page in TeamCity, I can see that the feed URL is http://localhost:8080/httpAuth/app/nuget/v1/FeedService.svc/.

I have set my local Visual Studio (running on my local machine, not the TeamCity server) as
http://[my-TC-server]/httpAuth/app/nuget/v1/FeedService.svc/, and I can view the package in the NuGet manager with the expected attributes.

However, when I try to install the package, it fails because the src attribute in the package configuration is still set to http://localhost:8080/httpAuth/app/nuget/v1/FeedService.svc/download/NuGet_[myPackage]/73:id/p[myPackage].nupkg (I can see this by viewing my TeamCity-hosted packages at http://[my-TC-server]/httpAuth/app/nuget/v1/FeedService.svc/Packages()), and the install fails because it is looking on my machine for the package file, and not on the TeamCity server. I assume the src attribute is set at pack time and grabbed from the TeamCity configuration somewhere.

If I navigate to to

http://[my-TC-server]/httpAuth/app/nuget/v1/FeedService.svc/download/NuGet_[myPackage]/73:id/p[myPackage].nupkg

in a browser, I can successfully download the package.

Is it possible to configure the feed URL in TeamCity to be http://[my-TC-server]/httpAuth/app/nuget/v1/FeedService.svc/ so that the src param will also use [my-TC-server] instead of localhost? I can't find an option in TC to do this, and I haven't found any documentation for dealing with this problem.

If it is not possible to configure the feed URL, what would a good solution be so that my local machine can download the package from my TeamCity server?

1
OK, I realized that the NuGet feed URL is determined from the TeamCity server URL (Administration>General Settings). I set the server URL to be [my-TC-server], and now the feed URL looks how I'd expect. However, the packages are still being generated with a "localhost" source URL. I wonder if I'm running into a caching issue at this point?Matthew Kemmer

1 Answers

3
votes

It was two things:

  1. I needed to configure my TeamCity Server URL (Administration>General Settings)
  2. I was running into this problem with my server's reverse proxy, and running this command on the server fixed the problem (the server was not preserving the Host header in requests)

After those two, everything's all good!