It's all about the answers!

Ask a question

auto switch source control bindings in VS .sln/.csproj files


Thomas Yu (1011199) | asked Apr 19 '10, 2:29 a.m.
hello, all,
We have two sites doing .net development, one using ClearCase, the other RTC.

The two sites (with a 12-hour time difference) work on a same VS project, so I have to synchronize the component consisting of the VS project between RTC and CC , on a daily basis.

Per Section "2 Migrating from another Source Control provider" in

Source Controlling Projects and Solutions in Team Concert for Visual Studio
http://jazz.net/library/article/117

I have to change the Source Control provider setting in .sln and .csproj files every day.

Surely I can develop a script to process .sln and .csproj files, and run the script as some post event during CC-RTC synchronizing. But this can be error-prone, leading to hidden mistakes.

Can RTC provide a feature that enables automatically switching source control provider in VS .sln/.csproj files during synchronizing?

thanks!

6 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Apr 19 '10, 11:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Have you looked into using the ClearCase Connector to automatically
synchronize your ClearCase and RTC development, rather than doing it
manually yourself?

Cheers,
Geoff

yetiscream wrote:
hello, all,
We have two sites doing .net development, one using ClearCase, the
other RTC.

The two sites (with a 12-hour time difference) work on a same VS
project, so I have to synchronize the component consisting of the VS
project between RTC and CC , on a daily basis.

Per Section "2 Migrating from another Source Control
provider" in

Source Controlling Projects and Solutions in Team
Concert for Visual Studio
http://jazz.net/library/article/117

I have to change the Source Control provider setting in .sln and
csproj files every day.

Surely I can develop a script to process .sln and .csproj files, and
run the script as some post event during CC-RTC synchronizing. But
this can be error-prone, leading to hidden mistakes.

Can RTC provide a feature that enables automatically switching source
control provider in VS .sln/.csproj files during synchronizing?

thanks!

permanent link
Thomas Yu (1011199) | answered Apr 20 '10, 3:41 a.m.
Have you looked into using the ClearCase Connector to automatically
synchronize your ClearCase and RTC development, rather than doing it
manually yourself?

Cheers,
Geoff

Yes, I am using ClearCase connector. After I synchronized a VS solution from ClearCase to RTC, I tried to open the solution in VS, ended up with dialog boxes saying these error messages:

The project '***' is under source control. An error occured registering this project with source control. It is recommended that you do not make any changes to this project.

and

One or more projects in the solution could not be loaded for the following reason(s):

The project file or web has been moved, renamed or is not on your computer.

These projects will be labeled as unavailable in Solution Explorer. Expand the project node to show the reason the project could not be loaded.


Obviously RTC-CC connector, during synchronizing, is not transforming source control bindings in .sln and .csproj files.

thank!

permanent link
Jean-Michel Lemieux (2.5k11) | answered Apr 20 '10, 8:20 a.m.
JAZZ DEVELOPER
Very interesting. It's true that VS doesn't like it when you work on the same project/solution but with different providers. I'm not sure which work around is possible besides running a script during synchronization which converts the binding information back and forth.

permanent link
Geoffrey Clemm (30.1k33035) | answered Apr 20 '10, 9:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Ah, I get it.

The ClearCase Synchronizer has no way of knowing which source control
provider you will next be using on that project, so it cannot guess
which settings to use.

This sounds like an instance of the general problem of there being some
settings in the IDE dot-files that are "user specific", and others that
should be shared by the team.

Does anyone have a solution for that general problem that they are happy
with? If so, we could probably apply it to this problem.

One possibility (just thinking out loud ... I haven't tried this myself):

Mark .sln and .csproj as not being under source control.
Create file types, .slnx and .csprojx that are under source control.

When you setup a new project, have as part of your IDE build setup a
step that creates a .sln/.csproj file from a .slnx and .csprojx.

Then as part of the IDE build, update the .slnx and .csprojx files
whenever the .sln and .csproj file has changed, but do not copy over
"user specific" information (such as in this case, the source control
bindings).

I've created work item 112588 to track this issue.

Cheers,
Geoff

yetiscream wrote:
gmclemmwrote:
Have you looked into using the ClearCase Connector to automatically
synchronize your ClearCase and RTC development, rather than doing it

manually yourself?

Cheers,
Geoff

Yes, I am using ClearCase connector. After I synchronized a VS
solution from ClearCase to RTC, I tried to open the solution in VS,
ended up with dialog boxes saying these error messages:

The project '***' is under source control. An error occured
registering this project with source control. It is recommended that
you do not make any changes to this project.

and

One or more projects in the solution could not be loaded for the
following reason(s):

The project file or web has been moved, renamed or is not on your
computer.

These projects will be labeled as unavailable in Solution Explorer.
Expand the project node to show the reason the project could not be
loaded.


Obviously RTC-CC connector, during synchronizing, is not transforming
source control bindings in .sln and .csproj files.

thank!

permanent link
Geoffrey Clemm (30.1k33035) | answered Apr 20 '10, 10:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Good suggestion, JM. It would be much simpler (although still not
trivial :-) to handle this as a specific case for the source control
provider info, and not try to tackle the general case of "user specific"
information in the IDE dot files. I'll update work item 112588 with
this "synchronizer script" idea.

Cheers,
Geoff

jlemieux wrote:
Very interesting. It's true that VS doesn't like it when you work on
the same project/solution but with different providers. I'm not sure
which work around is possible besides running a script during
synchronization which converts the binding information back and
forth.

permanent link
Thomas Yu (1011199) | answered Apr 27 '10, 4:41 a.m.
Thanks for all these good suggestions.
So I will write a script to update source control provider information coded in .sln/.csproj files and run it after each sync.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.