Recently, I have been facing this issue where my TFS(2015 update 3) msbuild runs with old code even after checking in changes and saving changes locally in visual studio 2015 enterprise edition. I use build to run Automated UI test by running my machine as test agent. I can see an agent workspace other than my workspace(don't know if anything to do with it).
Can anyone guide me to correct this issue, or anyway to move forward without facing this issue again?
Please try below items to narrow down the issue:
UPDATE:
Below screenshot for your reference, also make sure you mapped the source correctly. You can also try to delete workspace and entire source folder directly from your agent machine, eg C:\Agent\_work\2\s
(You can get the info from build log)