Visual Studio isn't tracking changes, or checking out files from source control as I edit them

45,293

Solution 1

Right-click on your solution node and go down to "Go online". For various reasons visual studio can mark your solution as tracked by source control, but "offline". It is still tracking changes behind the scenes waiting for you to go online again. After doing this my pending changes window populated and all is normal. I figured it was a simple setting somewhere.

Solution 2

I found an interesting setting under File > Source Control > Advanced > Change Source Control.

If I bind the solution and project to my source control server (unbind first if it's already bound), then suddenly it works! Saving a file automatically checks out the file and tracks changes.


Edit: this seems like a bug in Visual Studio. If this workaround helps you, it would be awesome if you create a new issue at https://developercommunity.visualstudio.com with your Visual Studio version info, so that the dev team can fix this!

Solution 3

Go into source control bindings (File->Source Control->Change Source Control) - you may notice only the project is bound - not the solution. Select the solution, click Bind.

Solution 4

I've just found how to fix this when you are already online (there is no "Go online" option visible). Actually, there ARE pending changes listed but they are hidden below the huge "Comment" section. To view them increase hight of the "Pending Changes" tab and decrease hight of the "Comment" section: you'll see the list of pending changes that was hidden by poorly scaled VS :)

Solution 5

in my case i solved issue by applying steps below:

  1. Right click your solution file on the solution explorer.
  2. click add solution to source control
  3. if you already added your files to tfs click ignore for file replacements popups
Share:
45,293
Chev
Author by

Chev

I'm a passionate developer and I love to learn. I also love to share my knowledge with others. Both of those are the primary reasons why I'm here on Stack Overflow :)

Updated on July 05, 2022

Comments

  • Chev
    Chev almost 2 years

    I am new to TFS. At my job I mapped the TFS projects to local directories, performed a get, and everything works as I expected. When I edit files on my local copy, source control automatically checks them out for editing and tracks the files with pending changes via the pending changes window. Then I just check them in throughout the day using that window.

    However, at home this doesn't appear to be happening. I have access to source control and using source control explorer, have mapped the projects to local directories. This appeared to work fine. However, when I open the projects and open files, changes I make are not automatically checking out files. In fact, visual studio isn't even changing their read-only status until I try to save my changes; at that point it warns me that the file is read-only and asks if I would like it to try to overwrite the permissions and save. I do and it works fine. But again, no changes register in the pending changes window. I'm kind of lost. The only source control experience I really have is subversion and the visual studio AnkhSVN plugin.

    I've even opened my solution by double-clicking the solution file that is in source control explorer. You would think it would be fully-aware that the solution I'm opening should be tracked by source control.

    Edit

    Since people seem to be questioning my use of the phrase "at home", let me clarify. There are no problems with the network. I am on a VPN. I can browse source control just fine. I have since reinstalled everything for various reasons. All went well. I'm just having an issue with Visual Studio not tracking changes to files and allowing them to be committed back to source control. So to sum it up:

    How could Visual Studio stop tracking changes after being mapped correctly, and allowing me to get latest? I can update from source control, I just can't commit. Pending changes window is empty even after making changes.

  • Hamish Grubijan
    Hamish Grubijan over 12 years
    I see the same symptoms but do not see the "Go Online" option. Any thoughts?
  • Jeffrey Blake
    Jeffrey Blake about 11 years
    If you are seeing this issue but can't find the "Go online" option, try opening any code file in the project, then go to "File -> Source Control -> Go Online". This option does not show up in the File menu while you the Source Control tab has focus.
  • J.Merrill
    J.Merrill over 9 years
    I had just written of my struggles, where TFS wasn't seeing changes made when I wasn't connected to it in VS. This answer showed up on the Related sidebar in SO -- thanks for answering my not-asked question! -- J. Merrill
  • BrainSlugs83
    BrainSlugs83 over 9 years
    Not relevant in your case, but for others: if you find that your solution is "online" and it's still not automatically checking files out when you edit them, you can check your settings under Tools->Options->Source Control->Environment, and verify that "Saving" and "Editing" are both set to "Check out automatically" and that "Allow checked-in items to be edited" is unchecked. -- Additionally, if you're using VS2012 or newer, verify that it is indeed a server workspace and not a local workspace; as the new "local workspaces" feature works a bit differently.
  • Brandon Wittwer
    Brandon Wittwer about 9 years
    Thanks for bringing the answer back to SO. I LOVE these hidden little features. Seems like there should be a more apparent indicator somewhere in the UI to let you know you're "Offline" even though I JUST got latest from SCE... :^|
  • Chev
    Chev about 9 years
    It's funny. This question hardly got any attention for like two years. Now all of a sudden in the last few months I've gotten a lot of rep from this question in particular. I'm no longer a .NET guy (I do node.js now), but maybe MS has introduced something that is making this more of a problem now.
  • Jason L.
    Jason L. over 8 years
    Oh my god thank you, this was driving me nuts all day long.
  • indofraiser
    indofraiser over 7 years
    I lost my link but clicked "Team Explorer" tab then right clicked at the top to go back online, I've put this as a comment as it's similar. The key seems to be finding "online".My issue came after the local VisualStudio\14.0 log was corrupted
  • Paul Gorbas
    Paul Gorbas over 6 years
    Thank you - this was my issue as well. My solution was bound but for some reason my 4 project children were not bound - clicking the bind button for the 4 project gave me back the missing functionality
  • Abe
    Abe almost 6 years
    Yes this did work for me too. But it is a tedious tasks, I have 400 odd projects i have to unbind them each one of them (cannot do multiples at the same time) and bind each one of them.
  • Carl Walsh
    Carl Walsh almost 6 years
    @Abe @ Paul if the issue is frustrating the way to get it fixed is to send feedback to MSFT through the website or from inside VS :) (I can't repro it; I don't work with TFS anymore.) If you do, paste the link here so we can upvote it!
  • Eric
    Eric over 5 years
    this one still works as of today! solved my issue as well.
  • tjans
    tjans over 5 years
    Solved my issue as well. Thanks!
  • Husam Ebish
    Husam Ebish about 5 years
    Thank you, in my case I have to add the solution to the source control (File -> source control -> add solution to source control)