Search code examples
visual-studiotfsworkspace

Can multiple Team projects point to the same source control in TFS?


I'm new to TFS so I'm trying to figure a couple of things out.

1) Are you allowed to reference the same code from multiple Team Projects?

2) How do you change the source control location for an existing team project?


Solution

  • The Server-Paths for each checked-in module has a format like $/TeamProject1/foo.cs.

    On the client-side, those files shall reside somewhere on the local HDD. The mapping between a $/TeamProject1/foo.cs & a local path C:/MyFiles/foo.cs is crafted by a TFS Workspace. Check here for an intro.

    To your questions:
    1) Are you allowed to reference the same code from multiple Team Projects?

    On the server side:
    You can have branched, or simply commonly named source files, as in
    $/TeamProject1/foo.cs & $/TeamProject2/foo.cs, but those are surely different files.

    On the client side:
    Each locally mapped source control folder can only be correlated with one local path. In case you try to map both $/TeamProject1/foo.cs & $/TeamProject2/foo.cs into C:/MyFiles/foo.cs you 'll be denied the second time with something like that:
    enter image description here
    In all, I think the answer to this question is a 'No'.

    2) How do you change the source control location for an existing team project?

    I suppose that you are trying to change the local mapping, for example from
    $/TeamProject1 & C:\Folder\teamProject1 into
    $/TeamProject1 & C:\AnotherFolder\TeamProject1

    In order to do that navigate in VStudio to "File">"Source Control">"Workspaces.." then select your workspace & hit "Edit". There you can see the existing mappings and edit them.