Search code examples
visual-studiomsbuildtfs-2015

TFS build runs with old code after checking in changes


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? Repository settings


Solution

  • Please try below items to narrow down the issue:

    • Check the source code via web portal, verify that the new changes are really checked in.
    • Check the definition setting, try to set "Clean" to "True" in Repository tab.
    • Also enable the "Clean" option in MSBuild step.
    • Try to create a new definition with the same settings, then try it again.
    • Clean the caches for your TFS Application Tier and agent machine, then try it again.
    • Reboot the TFS and agent machine

    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)

    enter image description here