views:

262

answers:

2

For some solutions, when I open them Visual Studio will get files that aren't in the project (particularly from obj/Debug) and add it to the changeset and I always have to perform a Undo Pending Changes operation on them. It's annoying. Is there any way to prevent Visual Studio from behaving in this way?

+1  A: 

Typically the obj/debug folders are not added as part of the source control when the solution is added. My guess is that someone explicitly added those to the source control when migrating your solution.

If you see those two folders in your source control tree, I would remove them. They will still be generated by builds on the local machine but won't participate in the check-in process.

j0rd4n
When I open it a dialog box appears showing Visual Studio adding it on its own.
Mark Cidade
Try this. Check to see if the folders are included as part of your project under the solution view in VS. Delete the folders in the TFS 'Source Control' view, remove them from the project, and then remove them from your local disk.
j0rd4n
+1  A: 

This is typically only a problem for Web Site projects. Because they include everything within the vroot into the "project" (which doesn't really exist), and if you bind that vroot to version control, then TFS says "hey if its in the project it shoudl be in version control". Web Application projects don't have that problem.

If this is happening when someone recursively adds files, then they should run a "Clean" on the build, delete .suo and csproj.user files before doing the add.

Geoff Cox