问题
Project files are take by TFS (Get Lates Version , Import Project , Check out for Edit -Prevent ...).Then "Undo Pending Changes" are applied.When I want to delete project from my local tfs repository(Connect to TFS Server ->Right click on the project -> Delete -> Delete project contents on disk is checked ->OK ) an error comes out and I cannot apply the delete operation:
Delete Source
An exception has been caught while processing the refactoring 'Delete Source'.
Reason:
Problems encountered while deleting resources.
Could not delete files...
Problems occured while deleting files
My local Eclips workspace is D:\denisa\workspace & TFS repository is D:\denisa.
I changed TFS local repository an set it as eclips workspace(D:\denisa\workspace) but same error occurs while deleting files.
After a while, although I click on the "plug" icon in Team Explorer and connect to TFS server, and apply delete operation again an error occurs about connection:
Delete Source
An exception has been caught while processing the refactoring 'Delete Source'.
Reason:
You can not remove the project ... while disconnected from your Team Foundation Server.If you wish to delete the project while offline, you may select the "Disconnect Project Permanently" to stop managing the project with Team Foundation Server. Then you may delete the project.
Then I click on the "plug" icon in Team Explorer and connect to TFS server again, and apply delete operation again, the same connection error comes aout again:
...
Reason:
You can not remove the project ... while disconnected from your Team Foundation Server....
Then I connect TFS project again, I right click on the project ->Team ->Disconnect Project Permanently ->make Delete operaion another error comes out:
Delete Source
An exception has been caught while processing the refactoring 'Delete Source'.
Reason:
Problems encountered while deleting resources.
Could not delete files...
Problems occured while deleting files
Then, I go to local workspace and see that in .metadata file there exist .lock file. I close Eclips, delete .lock file, open Eclips again ; lock file is created again. Then I go to TFS local repository, D:\denisa in my case, Righ Click on the project file -> Properties and in Attributes the Read Only is checked and I remved this check, Apply, Ok, and delete the file manually.
How can the problem be solved?
回答1:
You may try the following items:
Close all Eclips instances, clear TFS/DevOps caches
%LOCALAPPDATA%\Microsoft\Team Foundation\x.0\Cache
.Restart the Eclips as Administrator.
Check whether the account you connect to TFS/DevOps has correct permission to delete a project.
来源:https://stackoverflow.com/questions/65624006/unable-to-delete-project-files-from-local-tfs-repository-in-eclipse