Search code examples
c#tfslocationshareprojects

In TFS, how can I share source files in different location, in same machine, without sharing the full project


I want to publish some sample code for peoples, for example in CodeProject. But some source files (.cs files) are part of a large library that I don't want to publish completely.

How I can, in TFS 2012, share source files (.cs files) between 2 different projects (different location). That would let me update source as it would be updated by 2 different users, kind of.

I heard about Workspace but I'm not sure if it is the way to go and how I should do that?

I do not want to branch in order to only manage one version of each source file.


Solution

  • You just need to create a local mapping of the source files to a different workspace folder. Map the folders, don't map the full project.

    1. Create a new empty workspace
    2. Select those files which you want to share
    3. Click not mapped beside Local Path, choose a local location to map and get your source files from server. enter image description here

    Now you have two copies of your soucre files but with different workspace in your dev machine . When "another person" want to use these files on your machine, he just need to select the new workspace to work on it.

    enter image description here