Installing and configuring OData Service for TFS v2

This entry is part of a series, OData Service for TFS»

I have already written about Brian Keller’s excellent OData Service for Team Foundation Server. He has now published version 2 of the same service, check out his blog post for more information. Besides the new service, there is also a Windows 8 application that you can download that uses the same service. Let’s see what has been changed.

First you need to download OData Service and unpack it. Then download and install the following components:

That’s it. Open ODataTFS in code directory and navigate to Web.Config. Once there, find the following tag and simply point it to your TFS server (please note that currently it won’t work with TFS Service).

<add key="ODataTFS.TfsServer" value="https://tfs.codeplex.com/tfs" />

I also suggest that you comment out the following tag in the same config for the testing, do not turn it off in production:

<security mode="Transport"></security>

Hit Ctrl+F5 and you should be welcomed by a home screen:
tfs.odata.v2.1

If you are running this on IIS Express, your links will all be broken. To fix that, navigate to Default.aspx and change the following line:

var baseUrl = this.Context.Request.Url.GetComponents(UriComponents.SchemeAndServer & ~UriComponents.Port, UriFormat.UriEscaped).ToString();

to this:

var baseUrl = this.Context.Request.Url.GetComponents(UriComponents.SchemeAndServer | UriComponents.Port, UriFormat.UriEscaped).ToString();

Now all links should work. That’s it, now you have your simple OData service working for your on-premises TFS.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Last updated by at .

  • Sunil

    Thanks Toni..

    The line

    was throwing an error Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http].

    After removing that line..it works like a charm.

  • Mandrado Santos

    Thank you for sharing this. I had this same problem and I found help here.

    • http://www.tonicodes.net/blog/ Toni Petrina

      Glad I could help :)