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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With