Workaround: Conversion of source control provider in synchronized Visual Studio projects and solutions

Summary

Microsoft® Visual Studio stores source control provider information in its metadata files, which can cause problems during synchronization. This workaround explains how to convert the metadata files. The workaround is different by product version (prior to 3.0.1, or 3.0.1 and later) and this page explains both.

More Information

Visual Studio embeds information in its metadata files (.csproj, files, .sln files, etc.) about the source control provider in use. This source control provider information causes problems for synchronized projects and solutions because in a synchronized project which keeps these files under source control, both ClearCase and Jazz SCM will be used to develop the same Visual Studio artifacts. When a project initially developed using ClearCase is synchronized from ClearCase to Jazz SCM, the metadata files will still have ClearCase as the source control provider, and vice versa.

Because the metadata files also contain build information, it is desirable to keep them under source control with the rest of the project so that build information is shared. This page explains the workaround, and the workaround is different by product versions. Please skip to If you are using a version of Rational Team Concert prior to 3.0.1 if your product version is prior to 3.0.1.

If you are using Rational Team Concert 3.0.1 or later

In Rational Team Concert 3.0.1 or later, the ClearCase Synchronizer provides an option to automatically convert the source control provider information in Visual Studio metadata files as those files are sent back and forth during synchronization.

For example, a developer who works on Visual Studio with ClearCase integration makes a change to a Visual Studio project and checks it in to the ClearCase system. You synchronize the project and the synchronization process copies the change from ClearCase to Team Concert repository, and it updates the source control provider information in the metadata file automatically. When another developer who works on Visual Studio with Team Concert integration accepts the change to his/her workspace and open the project, the developer will see the project is source-controlled by Team Concert repository. So the developer can continue working with Team Concert repository after the synchronization. The metadata file is converted back to refer ClearCase as a source control provider when you make a change in Team Concert and synchronize the project, too.

The conversion of source control provider information is not enabled for your synchronized projects or solutions by default. Follow the steps below to enable the conversion. If you have not synchronized your Visual Studio project or solution yet, follow the steps in Setting up Visual Studio projects and solutions for synchronization. If you already have synchronized projects or solutions, follow the steps in Enabling the conversion of existing synchronized Visual Studio projects and solutions.

Setting up Visual Studio projects and solutions for synchronization

  1. Follow this task Setting up a ClearCase Synchronized Stream and merge workspace to create a synchronized stream.
  2. Before proceeding to synchronize a Visual Studio project, the metadata conversion option has to be enabled.
    1. Close Select Files to Synchronize wizard if it is opened.
    2. Open the ClearCase Synchronized Streams view.
    3. Right-click the synchronized stream in the table and click Properties.
    4. In the Properties dialog, select Jazz Provider Properties.
    5. In the Properties for this provider area, click the PROCESS_VISUAL_STUDIO_FILES property, and set its value to true.
    6. Select OK to close the dialog.
  3. Follow the rest of the steps as usual to set up a synchronized project. If you develop a Visual Studio project in ClearCase, the next step is Importing files and folders from Rational ClearCase. If you develop a Visual Studio project in Team Concert, the next step is Exporting files and folders to Rational ClearCase.

Enabling the conversion of existing synchronized Visual Studio projects and solutions

  1. Enable the metadata conversion.
    1. Open the ClearCase Synchronized Streams view.
    2. Right-click the synchronized stream in the table and click Properties.
    3. In the Properties dialog, select Jazz Provider Properties.
    4. In the Properties for this provider area, click the PROCESS_VISUAL_STUDIO_FILES property, and set its value to true.
    5. Select OK to close the dialog.
  2. Determine the current source control provider in the Visual Studio metadata file from the last time the file was synchronized.
    1. Open the solution file or the project file ( *.sln, *.csproj, etc. ), not the one you modified locally, but the one source-controlled.
    2. See which source control provider the file has. You can look at the lines described below.
  3. If it is ClearCase, go to the ClearCase system and make a harmless change to the metadata file (such as adding a space at the end), and check it in to the ClearCase stream or branch.
  4. If it is Team Concert, go to the Team Concert system and make a harmless change to the metadata file (such as adding a space at the end), and deliver it to the synchronized stream.
  5. Repeat the steps 2-4 for all solution files and project files.
  6. The next synchronization will convert the source control provider appropriately.

If you are using a version of Rational Team Concert prior to 3.0.1

Apart from managing the files outside of an SCM system, the only way to work around this problem is to manually bind the source control provider information if the files have the wrong information for the provider in use.

For example, if a .sln file in Jazz SCM appears as:

Microsoft Visual Studio Solution File, Format Version 10.00   # Visual Studio 2008   Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonTypeExtension", "CommonTypeExtension.csproj", "{ABE0031F-161E-4656-8729-87607FBF09D5}"   EndProject   Global           GlobalSection(RationalClearCase) = preSolution                   SourceControlProvider = RationalClearCase           EndGlobalSection           GlobalSection(SolutionConfigurationPlatforms) = preSolution

the provider must be rebound so that it appears as:

Microsoft Visual Studio Solution File, Format Version 10.00   # Visual Studio 2008   Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonTypeExtension", "CommonTypeExtension.csproj", "{ABE0031F-161E-4656-8729-87607FBF09D5}"           GlobalSection(JazzSourceControlProviderSolutionProperties) = preSolution                   SolutionIsControlled = True                   SolutionBindings = <Solution Location In Database>           EndGlobalSection   EndProject   Global           GlobalSection(JazzSourceControlProviderSolutionProperties) = preSolution                   SolutionIsControlled = True                   SolutionBindings = <Solution Location In Database>           EndGlobalSection           GlobalSection(SolutionConfigurationPlatforms) = preSolution

If a .csproj file in Jazz SCM appears as:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">     <PropertyGroup>       <ProjectType>Local</ProjectType>       <ProductVersion>8.0.50727</ProductVersion>       <SchemaVersion>2.0</SchemaVersion>       <ProjectGuid>{ABE0031F-161E-4656-8729-87607FBF09D5}</ProjectGuid>       <SccProjectName>Rational ClearCase</SccProjectName>       <SccLocalPath>Rational ClearCase</SccLocalPath>       <SccAuxPath>Rational ClearCase</SccAuxPath>       <SccProvider>Rational ClearCase</SccProvider>       <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>  

the provider must be rebound so that it appears as:

<?xml version="1.0"?>   <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">     <PropertyGroup>       <ProjectType>Local</ProjectType>       <ProductVersion>8.0.50727</ProductVersion>       <SchemaVersion>2.0</SchemaVersion>       <ProjectGuid>{ABE0031F-161E-4656-8729-87607FBF09D5}</ProjectGuid>       <SccProjectName>&lt;Project Location In Database&gt;</SccProjectName>       <SccLocalPath>&lt;Local Binding Root of Project&gt;</SccLocalPath>       <SccAuxPath>&lt;Source Control Database&gt;</SccAuxPath>       <SccProvider>Jazz Source Control Provider:{AC8810C5-F6E7-4145-83AA-FDFFF6F5506D}</SccProvider>       <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

See this support tech note for more information about binding source control providers in Visual Studio.

Related Information

The following links point to related information:


Feedback
Was this information helpful? Yes No 0 people rated this as helpful.