TFS and VSTS API: NuGet for dependencies

Much of the pain around including references to TFS assemblies and other dependencies can be removed by using NuGet to set up the assemblies. The only gotcha I found was that if you are importing a VS project whose target framework is say 4.0, then the NuGet execution fails.
In those cases, target say 4.6 and things will be fine.
Using the NuGet rather than adding references by hand does create an enormous amount of bloat, as the NuGet package picks up anything that MIGHT be needed as a dependency, and sticks it under References.

So working through the example screenshots below, the flow shows (credit here btw for the source Solution):

  • The build fails because the References cannot be found
  • We do an initial NuGet execution, which also fails
  • We then move from the 4.0 target to 4.6
  • Redo the NuGet import
  • Rebuild – compile succeeds

https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/

Install-Package Microsoft.TeamFoundationServer.ExtendedClient

 

 

Advertisements

TFS/MTM API – Nuget

Just dumping notes tonight, as just need to get things recorded and move on.

Install-Package Microsoft.TeamFoundationServer.ExtendedClient -Version 15.112.1

https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient/

TFS API

As a starting point for walking through TFS objects, I took this code , changed it a bit, giving this:

The references required are these:

The location of those DLLs is here (for me – I am btw using the VS2017 Enterprise preview (October 2017):

C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

Running that gives something like this:

tfs09

 

TFS: Installing locally for free (legally). Why?…

At work, I want to get ahead on using the TFS API to drag data out of the MTM/TFS repository especially around test related queries, e.g. for a given test case id, tell me what test suites that appeared in: that is actually impossible for MTM/TFS (2012) to do out of the box. However the TFS API is very capable. All my POC/sandbox work is done at home. But TFS is not something that you just install… or so I thought. In fact there is a perfectly adequate TFS 2013 Express which you can use for development, and run the server on your own box (I have a number of Visual Studio Online web sites, but as Work does not have VSO, that fact is useless for this exercise).

In about 1.5 hours I managed to get a working TFS, with me and Jan as administrators (she will never know 🙂 ), a Feature, a Story, and some dummy test cases attached. Although any chronological sequence in the screenshots below is dependent on how WordPress loads them, they anyway give a pretty full story of how I got to that point. There is no reference to MTM because at this point I don’t need its artefacts – the test executions can wait. So this is just the raw material right now. And just looking at the top photos, yes the sorting seems to be entirely name-based at first glance. Another day I’ll get PowerShell to do a time-based renaming. For now…

aaTfs01 TeamExplorer01 TeamExplorer02 TeamExplorer03 TeamExplorer04 TeamExplorer05 TeamExplorer06 TeamExplorer07 TeamExplorer08 TeamExplorer09 TeamExplorer10 TeamExplorer11 TeamExplorer12 TfsAddCollectionInVS01 TfsAddCollectionInVS02 TfsAddCollectionInVS03 TfsAddCollectionInVS04 TfsEXpress01 TfsEXpress02 TfsEXpress03 TfsEXpress04 TfsEXpress05 TfsEXpress06 TfsEXpress07 TfsEXpress08InAsAdmin TfsEXpress09Console TfsEXpress10Console TfsEXpressAdminConsole01 TfsEXpressAdminConsole02 TfsEXpressAdminConsole03 TfsEXpressAdminConsole04 TfsEXpressAdminConsole05 TfsEXpressAdminConsole06 TfsEXpressAdminConsole07 TfsEXpressAdminConsole08 TfsEXpressAdminConsole09 TfsEXpressAdminConsole10 TfsEXpressAdminConsole11 TfsEXpressFree TfsEXpressWebConsole01 TfsPerms01 TfsPerms02 TfsPerms03 TfsProjectVisibleInAdminConsole01 TfsSuccess01 TfsWeb01 TfsWeb02 TfsWeb03 TfsWeb04 TfsWeb05 TfsWeb06