NuGet Server Trailing Slash and Package Restore

We have TC acting as our NuGet server and we enable Package Restore on our projects.

It appears that TC wants the nuget url to have a trailing slash i.e. http://www.mybuildserver.com/guestAuth/app/nuget/v1/FeedService.svc/ vs  http://www.mybuildserver.com/guestAuth/app/nuget/v1/FeedService.svc

Requesting the former works while the later returns a 404.

NuGet's Package Restore seems to be ripping the trailing slash out of the URL so that when it tries to access the url it is getting a 404. I don't seem to recall having this problem with 7.1, it seemed to start after I upgraded to 7.1.1.

Is there a way to configure TC to handle the trailing slash?

Thanks,
Joe

11 comments
Comment actions Permalink

Ok, so it was not a Package Restore problem but is, I think a TeamCity problem.
I am using the "NuGet Installer" runner and it needs both the nuget.org urls and our nuget feed url. It says to use %teamcity.nuget.feed.server% to reference the TC nuget server, but you still have to append the trailing slash i.e. %teamcity.nuget.feed.server%/

0
Comment actions Permalink

Hello,

The is a known issue. Please vote for http://youtrack.jetbrains.com/issue/TW-23853
We fixed it in 7.1.2.

0
Comment actions Permalink

I'm running 7.1.4 and this is still broken, when I try to enable package restore using TC as the
nuget server, it returns a 404. If I add or remove the slash, no difference, 404 every time
.

D.Mills

0
Comment actions Permalink

Dean,

please check if you have NuGet feed enabled in Administraction | NuGet | Feed page on web UI.

If you open the link to the feed in browser, please check value of xml:base is the same as you see in the browser.

0
Comment actions Permalink

Hi Eugene,

I do have the authenticated feed enabled (not public though). Everything else seems to work fine, I set VS 2012 to use it as a source, enter my credentials, and I can view and install the packages, I just can't enable package restore, which I really need to do for these projects. Let me know if you need any more info.

D

0
Comment actions Permalink

Please check the feed URL you use locally is accessible from build agents

You may use %teamcity.nuget.feed.server% parameter reference to refer to NuGet feed that is available from build agent.

Authenticated feeds are only supported from TeamCity 8.0 EAP ( or you may install build from v0.9 branch of NuGet support to your server ),
For older version I do recommend to use feed without authentication.

Do you use TeamCity build runners or do you use NuGet provider packages recovery feature?

0
Comment actions Permalink

For testing right now the agent is running on the same machine, so it's all localhost and it works fine.
For testing I could use no authentication, but that would never be allowed for production I'
m afraid, any idea when 8.0 will be available? Can I get it now?

I'm trying both approaches, using runners and also NuGet recovery feature. I have package restore enabled for the solution (it worked from the build agent sources, I updated git from there). But when I try to run a nuget sources update, I get a 'Package restore is disabled by default.' error, even though it's a commandline nuget command for that build step, and shouldn't be touching the solution file. The step is:

D:\buildtools\nuget.exe sources add -Name TeamCity -source "http://localhost:808/httpAuth/app/nuget/v1/FeedService.svc/" -UserName build -Password password

Not sure why I'd get the package error on that command. I am using the above command, because the next step is a NuGet Installer step, and it fails with:

[install] Please provide credentials for: http://localhost:808/httpAuth/app/nuget/v1/FeedService.svc/

So I'm stuck I guess, using no auth would likely work in test, but I can't do that for production, which is screaming for nuget support :(

D

0
Comment actions Permalink

Hello,

We have TeamCity 8.0 EAP and we plan to release 8.0 in several months.
You may grab a build of NuGet support plugin from public TeamCity server.
The plugin from v0.9 branch should be compatible to 7.1.x build
Please find more details at
http://confluence.jetbrains.com/display/TW/NuGet+support

0
Comment actions Permalink

I grabbed the latest v0.9 branch plugin, put it in <TeamCity Data Directory>\plugins, restarted the TeamCity server, NuGet support is still coming up as the built-in plugin (24170) and it is not listed as an external plugin the way the other ones are. So I guess it's not compatible?

0
Comment actions Permalink

Please update plugin under <teamcity server>/webapps/root/web-inf/plugins folder.

0
Comment actions Permalink

That did the trick, thanks! On to test it out now.

D

0

Please sign in to leave a comment.