For my customer I was implementing some advanced BuildNumbering mechanism (Here can you find a good post about this). Because it was important that the stuff worked, I wrote some Unit Tests. I usually do that and need IBuildDetail.
Jim Lamb has a great post about how to stub The IBuild…interfaces when you create your own custom activities. http://blogs.msdn.com/b/jimlamb/archive/2009/11/18/how-to-create-a-custom-workflow-activity-for-tfs-build-2010.aspx
Because I needed to get some information about the BuildDefinition I created a stub for IBuildDefinition as well. Then I got the following error:
‘Microsoft.TeamFoundation.Build.Client.IProjectFile’ is obsolete: ‘This interface has been deprecated. Please remove all references.’
You don’t have to guess what happened when I followed the guidance in the error message. To solve this is actually very simple and has nothing to do with build.
Mark the Obsolete methods and properties in your stub with the [Obsolete] Attribute
Works like a charm!
Thanks to William Bartholomew for pointing this out to me!