Application JSON error

Jun 6, 2013 at 7:40 AM
When I ran the tfs drop downloader an exception was thrown "Unsupported Content Type"
The Request Uri was :

Am I doing something wrong here ?
Jun 6, 2013 at 11:05 PM
Edited Jun 6, 2013 at 11:07 PM

Do you mean you passed "" as value of collectionUri parameter ?

The TfsDropDownloader is not meant to download any random file from TFS server, it only downloads the drop produced by your build.

If you type TfsDropDownloader.exe /? from a CMD window, you can see a detailed usage information.

In your case, the collectionUri should be, and you need to specify other parameters like team project name, build definition name etc.

If this does not resolve your issue, please let us know.

Paste the help information from the command line tool for convenience:

Download a build drop published to the TFS server.

TFSDropDownloader.exe /c:<collectionUrl> /t:<teamProject> /b:<buildDefinition>
/u:<username> /p:<password> [/n:buildNumber] [/o:outputFile] [/?]

/c The TFS project collection URL.

/t TFS team project name.

/b Build definition name.

/u TFS account user name.

/p TFS account password.

[/n] The build number of the target drop.
    If not specified, latest good drop will be downloaded.
[/o] Full file path to save the downloaded drop, e.g. C:\MyDrops\
    If not specified, the drop will be saved in the current working directory.
[/?] Display this message.

Jun 12, 2013 at 10:03 AM
Hi Yanchen,

I get a similar error to melvinvermeer. Using the command line tool I do this:
TfsDropDownloader.exe /c:"" /t:"ProjectName" /b:"BuildDefinitionName" /u:username /p:password
...and get an empty zip file with the correct build label name of the last successful build e.g.

Running the source code in the debugger, this is because the URL that is generated for downloading:
..returns a content type of application/json, which is unsupported. This exception is swallowed by the application, but not before the empty zip file is created.

Is it possible the REST API on Team Foundation Service has changed in some way so the generated URL is no longer correct?

Note that I am using the "alternate credentials" defined on my Team Foundation Service account (i.e. not my live ID) - using anything else gets me TF30063: not authorized.


Jun 12, 2013 at 5:44 PM
Edited Jun 12, 2013 at 5:45 PM
Hi Tim,

Using the alternate credentials should be fine to download the drop.

I encountered the same issue when I created this tool, it is usually because the authentication failed.
At that time, the root cause for my problem is because my password contains a special character which needs to be escaped in command line window. I changed my password and it worked.

Is it by any chance you also have special characters in your password?

If this does not resolve the issue, can you paste the json message so we can see what the message is ?

Jun 13, 2013 at 11:52 AM
Hi Yanchen,

I got it working by using alternate credentials, but I also had to access the REST API via a different path.

The current utility builds a URL that looks like this:
This returns empty JSON whenever I try to use it. I'm definitely authenticated, because if I tweak the URL to:
I get a nice JSON listing of every single file in the drop, but no zip.

From spying on the SSL traffic to with Fiddler I saw that clicking the "Download drop as zip" link I can see that there is another endpoint at:
...which does give you a zip. The "vstfs%3a%2f%2f%2fBuild%2fBuild%2f639" portion is the URL encoded BuildUri.

So I've changed my version of GetServerPath to do this:
private static string GetServerPath(TfsConnection collection, IBuildDetail buildDetail)
    var downloadPath = string.Format("{0}{1}/_api/_build/ItemContent?buildUri={2}&path=%2Fdrop",

    return downloadPath;
This works for me for the time being. It's a bit concerning how the REST API is undocumented though. Are you sure your command line tool still works against the API since 30 May? I cannot get it to work, and reading the bottom of this forum post there may have been some changes to how drops are stored.


Jun 19, 2013 at 9:19 PM
Hi Tim,

We've identified that the TFS online update indeed broke this tool.
We're in the progress of fixing this issue.
Should be able to update the tool sometime next week.

Tim, thank you for reporting the issue!