Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Files are locked in TFVC by another user

Posted on by 250
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?
  • Verified answer
    Anthony Blake Profile Picture
    Anthony Blake 2,149 Super User 2024 Season 2 on at
    Files are locked in TFVC by another user
    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
  • Jason0810M Profile Picture
    Jason0810M 250 on at
    Files are locked in TFVC by another user
    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.
  • Martin Dráb Profile Picture
    Martin Dráb 229,918 Most Valuable Professional on at
    Files are locked in TFVC by another user
    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.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,113 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans