+1 703.350.4150 Have TeamExpand Call You Leave a Message

"I really like the way you can access your work items from within Outlook. I like the way you can bring up the full work item forms, make edits, and save immediately to TFS. It was great to create new meeting requests or mail messages from the work items."

Lori Lamkin
Product Unit Manager for Team Foundation Server at Microsoft

"These types of products are important to the industry."

Joel Semeniuk
CEO and co-founder of ImagiNET Resources Corp.

"I know of a good number of companies that will love having something like this - getting their timesheet management into TFS (so it can be reported on, especially) will make life a lot easier for them."

James Manning
Software Design Engineer for Visual Studio project at Microsoft

"I like the idea of being able to link work items to e-mails and meetings. I also like that it provides non-technical information workers the option of working with TFS in a more familiar environment. Congratulations to TeamExpand on the release!"

Jason Barile
Principal Test Manager for Visual Studio Team Foundation Server at Microsoft

"TX Chrono, by TeamExpand, allows users to easily track how they are spending their time, store that information in TFS, and make it available for reporting in the warehouse."

Brian Harry
Product Unit Manager for Team Foundation Server at Microsoft

Left 1 2 3 4 5 Right
TFS Timesheet

VSTS-Outlook Bridge

Blog

TFS 2010 Issue: Same Names for Different Assemblies

July 6th, 2010
by Petr Pruidze, .NET Team Lead

Hi, everyone. I want to describe an issue I’ve recently faced when working on a TFS-based project and share the original solution found.

The Issue

The project utilized Team Foundation Server assemblies. The need to use both TFS 2008 and TFS 2010 assemblies aroused when TFS 2010 was released. In short, the names of the assemblies stayed the same, while their versions were different.

The Solution

As you can guess, this issue had a number of solutions and it’s not the purpose of this post to make you think that mine is the best one. :)

Our team elaborated on several ways to solve this problem:

  1. Create two different branches for the project—each branch for each version of assemblies. However, we’ll have to support both branches in this case, which is not a great idea.
  2. Use reflections. This method is really good, but requires a great deal of time on implementation and testing.
  3. Compile the project for different versions of assemblies, depending on the chosen “Solution Configuration” option. Let’s have a deeper insight into this option, since it appears to be the best way to solve the issue.

Below is a step-by-step guide on implementing the solution.

To start with, open Configuration Manager.

Create a new configuration that will be used for build-building other TFS version. I’ve named the new configuration as “BuildRelease2010.”

As you may see, there’s no need to create a new configuration for each project in your solution. You may do this only in case your project utilizes different versions of assemblies—just like I had.

Open the properties of the projects that are supposed to be built with different versions of assemblies. Add “Conditional compilation symbols” to the new configuration.

Open the code itself and add the condition for working with different assemblies, if needed. In my case, the creation of the instance that implements the IserviceProvider interface required working with different versions of assemblies.

#if BUILD_RELEASE_2010
TfsTeamProjectCollection server = newTfsTeamProjectCollection(newUri(tfsUrl));
#else
TeamFoundationServer server = TeamFoundationServerFactory.GetServer(tfsUrl);
#endif

Open the .cproj file in Notepad or any other text editor, find the Reference to your assembly (in my case, it was Microsoft.TeamFoundation.dll), and add the following Condition tag: (Condition=”‘$(Configuration)’!=’BuildRelease2010′”).
..\Bin\TFS\Microsoft.TeamFoundation.dll

Now add the Reference to the new version assembly with the opposite Condition:
..\Bin\TFS2010\Microsoft.TeamFoundation.Client.dll

That’s it. Choose the configuration needed and start build-building, voila!

Pros

Implementation is fast and easy.

Cons

The look is not so preppy, as it could have been. :)

If you had the same issue, how did you solve it?

Add your own comment...

Post Comment





RSS entries or comments