I cannot re-create the file if it is controlled by TFS.
Steps to reproduce:
- Create a new console app.
- Add a new file: Class1.cs
- Check-in entire solution to TFS.
- Remove Class1.cs.
- Create a Class1.cs again.
I get a message box with an error:
Check Out. The item <…> could not be found in your workspace, or you
do not have permission to access it.
File will be created, but there will be no TFS icon near it in the “Solution explorer”. And the file will still be marked as deleted in the “Pending changes”, not as updated.
So if I want to recreate the file, I have to
- Remove the file
- Check-in the changeset (which leads to broken CI-build)
- Create the file.
The question is:
Is that by-design for local workspaces? Or is that just a bug, that will be fixed later? Or it’s just my local bug, and nobody can reproduce it on their machines?
P.S. I need to re-create some files, for example because there are some convenient VS-tools for creating WCF RIA Domain service classes (with all related metadata), but there are no tools to update them. And I don’t want to change the name of the domain service, otherwise I’ll have to update clients.
UPDATE:
I just tried to reproduce the bug on another PC.
File Class1.cs was successfully recreated and it was marked as “updated”.
There was no messagebox window, but there was the same message in the Output window:
The item <…> could not be found in your workspace, or you do not have permission to access it.
If I try to recreate EDMX-model then I still get a messagebox with that error, but files are successfully recognized as edited.
I don’t understand, what is the difference between these two PCs.
To Mr.Radwan.
Now everything works as expected.
When I recreate a file, now I have a message in the output window instead of the dialog window. The file is marked as edited.
In some cases it’s easier to recreate the file, then cleaning it.