简体   繁体   中英

TFS2008 & VS2008 : File deleted from Solution Explorer still appears in Source Control Explorer

I'm seeing some weird behavior from VS2008 integrate with TFS 2008. When I delete a file from a solution from within the Solution Explorer and check it in, the file still appears in the Source Control Explorer.

In the Source Control Explorer the file appears having the value 'delete' under the Pending Change column. It also appears in the Pending Changes window with the same status and I'm forced to check it in from there.

Any idea whether this is "normal" and if it is, what the rationale behind it is? How can I avoid having to twice check-in the file deletion?

How did you check in, exactly? My guess is you did it from the Solution Explorer context menu. When the Checkin modal dialog pops up, even though it shows your entire list of pending changes, by default only items that are currently in the solution will be checked.

This is another reason why I don't recommend invoking important operations from Solution Explorer. Automatically pending changes for you is convenient, but operations that modify state (eg Get, Checkin, Shelve) deserve more care.

Edit: to reflect comment.

This is strange I don't get this behavior and nor does anyone at our sites. If we delete a file in Solution Explorer (select file and hit delete) it becomes a pending change. Then I can checkin the change. I have to ensure that I select the deletion in the check in/pending changes windows. Then It no longer appears as a pending change in Source Explorer. In fact I can check in and check out in either window and the change is reflected in the other instantly.

====

Deleted files remain in TFS. To completely remove a file you have to 'DESTROY' it not delete it. This is essentially source control in action. If you don't want to see the file then there is a setting in visual studio to hide them. Personally I prefer them there, as you can see the history and they are a visual reminder.

After deleting the file, you need to commit the deletion - this is essentially checking in the deletion. After this the file will remain in the source explorer but be greyed out. You can then do things like I mention above.

What is the setting of Tools | Options | Source Control | Visual Studio Team ... | Show Deleted Files in the Source Control Explorer?

This defaults to unset, but if it has been set then deleted files will appear.

Ung,

This behaviour is totally normal - if somewhat confusing - as when you delete a file from a solution, that file is marked as pending delete in Source Control, but when you check in via the Solution Explorer, at the point of check-in that file no longer falls under the scope of the Solution.

If you delete files from a solution at any point, just remember to check-in from the Source Control Explorer.

Antony

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM