0

I'm trying to retrieve a build from history. It appears there is a change that has affected my code. I need to go back through several submissions to find when the base line is working, to identify the cause for my code issue. I don't understand how to use VS2019 with Azure DevOps "team solution" to do this.

Not clearly seeing the options necessary from my internet searches.

Help please.

auldh
  • 19
  • 3
  • 2
    Are you using Git or TFVC for source control? You manage builds from the Azure DevOps portal, not from Visual Studio. – Daniel Mann Aug 04 '20 at 19:26
  • 1
    I'm assuming you are meaning build = specific commit or file version in the context of this question. Is that accurate. So are you asking how you can get locally the the version of code that corresponds to previous builds? Knowing whether you are using Git or TFVC to provide you any useful steps. – Matt Aug 04 '20 at 20:16

2 Answers2

1

Visual Studio does not store a history of builds. Just the most recent one for each project configuration. The next build will replace it (or next clean delete it).

Azure DevOps Pipelines do keep a history of builds done in each pipeline (the default is 30days IIRC): they can be accessed via the Web UI.

If you are not using continuous integration – and thus no pipelines – there will be no older builds.

You could checkout earlier versions from change control and build those locally...

Richard
  • 106,783
  • 21
  • 203
  • 265
  • 1
    Can you elaborate on "checkout earlier version" This sounds like what I want. I see in "team solution" history showing previous submissions. How do I get them from Azure DevOps and VS2019? – auldh Aug 04 '20 at 19:18
  • 1
    @auldh You'll need to learn about the version control you are using/ Both TFVC and git (unless the project is more than a few years old git is more likely): both are widely documented (far better than I could in an answer here). – Richard Aug 04 '20 at 20:22
1

As it is pointed out Visual Studio does not keep builds history. If you mean retrieving a previous version of your codes, you can check out below workarounds:

If you are using Git, you can go to your local repo folder, open git bash and run below git commands:

git log to fetch the previous commits. See document about git log command.

git checkout <commit> . to revert back to the commit you selected

Check out this thread for more information.

For TFVC: You can use roll back command tf rollback /changeset:ChangesetFrom~ChangesetTo. See document Rollback Command for more information. You can also check out this thread.

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43