web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Files are locked in TFVC by another user

(2) ShareShare
ReportReport
Posted on by 8
Hello,
I am having an issue with VS 2019 TFVC.
Every objects are configured such that anyone who edits a particular object (class, table, project, etc), the files are locked to that user in the workspace.
Other users cannot perform modification on that particular object.
I have an external user who was using a virtual machine and there were some objects that were locked in that workspace.
Before leaving the company, he has deleted the virtual machine dev09 but the files that were locked are still locked in that workspace (dev09).
His workspace was set to private and it inaccessible to anyone.
Is there any way to fix this issue and unlock these files as we are in need to edit some of the objects for development?
I have the same question (0)
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at
    It's possible, either from Source Control Explorer or command line, you just need UnlockOther permission.
     
    With sufficient permissions, you can also delete someone else's workspace.
  • Jason0810M Profile Picture
    8 on at
    Hello Martin,
    I have tried to ask the admin team to unlock as I don't have the rights but they are unable to run the command to unlock for this particular user/workspace and the account has been deleted from the system.
    It seems that deletion of the workspace is the only solution now.
  • Verified answer
    Anthony Blake Profile Picture
    2,926 Super User 2025 Season 2 on at
    Make sure your workspaces are set to public to avoid in future, you probably know that now but this is something I've had multiple times in the past.
     
    Try this:
     
    tf vc workspaces "<ENVIRONMENTNAME>;<USER>" /computer:* /format:xml /collection:https://YOURPROJECT.visualstudio.com/ 
     
    This should give you an xml output so you can get the owner ID
     
    Then use this command to delete the workspace:
     
    tf workspace /delete "<ENVIRONMENTNAME>;<OWNERID>" /collection:https://YOURPROJECT.visualstudio.com/ 
     
    I've found these a real pain to clean up, it may be worth deploying a new dev environment.
     
    Other suggestions:
     
     

    From the link:

    You can get a list of all workspaces by bringing up a Visual Studio Command Prompt then changing to your workspace folder and issuing the following commands:

    C:\YourWorkspaceFolder>tf workspaces /owner:*
    

    You should see your problem workspace in the list as well as it's owner.

    You can delete the workspace with the following command:

    C:\YourWorkspaceFolder>tf workspace /delete /server:BUILDSERVER WORKSPACENAME;OWNERNAME

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans