‘Microsoft.TeamFoundation.Build.Client.IProjectFile’ is obsolete

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

 

image

 

Works like a charm!

Thanks to William Bartholomew for pointing this out to me!

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: