Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude from project, source control issue

Tags:

tfs

I'm using team foundation server 2010 @ work and home. I want to exclude some element from the project build but still have them exist in Team Foundation Server 2010 source control. How do I achieve this? Exclude From Project will delete the item.

like image 588
Nickz Avatar asked Aug 18 '10 06:08

Nickz


People also ask

How do I exclude a file from Source Control?

You can just simply select the file from your Source Control Explorer and Right Click on it, and the select the "Rename" option from there, and you can add ". exclude" at the end of the file name. And then do remember to check-in the file, and after that you can see that your file is excluded from Source Control.

How do you exclude a project from a solution?

To temporarily remove a project from the active solution configuration. On the menu bar, choose Build > Configuration Manager. In the Project contexts table, locate the project you want to exclude from the build. In the Build column for the project, clear the check box.


2 Answers

Same problem here, only way to do this is manually edit project file :(

Please vote that this bug is important to fix

https://connect.microsoft.com/VisualStudio/feedback/details/573582/vs-2010-exclude-from-project-deleting-files-from-source-control

Workaround posted on Connect:

Open the csproj file in notepad and find the files that need to be excluded and remove or comment the compile element for that file, and any related designer and resx files.

like image 105
Antonio Bakula Avatar answered Oct 12 '22 07:10

Antonio Bakula


Editing a project file and removing the references to the files you want to exclude would be the easiest solution.

Another solution would be to remove files from the project via UI, but only checkin changes in the project file and undo the delete operations.

In the future you can add files directly to the TFS folder in Team Explorer.

May I ask: why would you want to do that? As I commonly have a problem of files which are not bound to any project and have to be getted manually.

like image 22
BanditoBunny Avatar answered Oct 12 '22 05:10

BanditoBunny