How does Visual Studio's source control integration work with Perforce?
- by Weeble
We're using Perforce and Visual Studio. Whenever we create a branch, some projects will not be bound to source control unless we use "Open from Source Control", but other projects work regardless. From my investigations, I know some of the things involved:
In our .csproj files, there are these settings:
<SccProjectName
<SccLocalPath
<SccAuxPath
<SccProvider
Sometimes they are all set to "SAK", sometimes not. It seems things are more likely to work if these say "SAK".
In our .sln file, there are settings for many of the projects:
SccLocalPath#
SccProjectFilePathRelativizedFromConnection#
SccProjectUniqueName#
(The # is a number that identifies each project.) SccLocalPath is a path relative to the solution file. Often it is ".", sometimes it is the folder that the project is in, and sometimes it is ".." or "..\..", and it seems to be bad for it to point to a folder above the solution folder. The relativized one is a path from that folder to the project file. It will be missing entirely if SccLocalPath points to the project's folder. If the SccLocalPath has ".." in it, this path might include folder names that are not the same between branches, which I think causes problems.
So, to finally get to the specifics I'd like to know:
What happens when you do "Change source control" and bind projects? How does Visual Studio decide what to put in the project and solution files?
What happens when you do "Open from source control"?
What's this "connection" folder that SccLocalPath and SccProjectFilePathRelativizedFromConnection refer to? How does Visual Studio/Perforce pick it?
Is there some recommended way to make the source control bindings continue to work even when you create a new branch of the solution?