Microsoft Developer Network > 포럼 홈 > Team Foundation Server - Build Automation > Build Retention Policy and Deleted Version Labels
질문하기질문하기
 

답변됨Build Retention Policy and Deleted Version Labels

  • 2008년 9월 25일 목요일 오후 3:31HATLANTA 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

     

    Thanks in advance, everyone.

     

    I have the retention policy in my builds to only keep the last two good builds, and that's fine.  However, when I used the Label Sidekick to view a baseline (version label) from many builds ago, that's when I realized that all my prior build labels are no longer on the code, and only the last two build labels still exist.

     

    How can I set up TFS so that I keep my build retention policy to only keep the last two good builds, and leave all the build version labels that are applied?

     

    I suppose I could add a target to the build script that'll assign a new label to the current build label, and that may work. But more importantly, I'd like to understand the connection between build version labels and the retention policy.

     

    Thanks.

답변

  • 2008년 9월 30일 화요일 오후 12:47Jason Prickett - MSFTMSFT사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    Bill is right. That is our default behavior. However, in SP1 we added the ability to keep your labels. Here is how:

     

    The build admin can add a flag to the Web.config file on the Application Tier to specify that labels should not be deleted. Here is an example of what that line in the web.config file would look like:
    <add key="PreserveLabelsOnBuildDeletion" value="True"/>

     

    You may need to restart IIS to force the use of the new Web.config.


    When this value is present, labels are not deleted from Source Control. The default behavior is still the same as RTM; labels get deleted with their corresponding builds.

     

    Hope that helps,

    Jason

     

모든 응답

  • 2008년 9월 29일 월요일 오전 2:58Bill.WangMSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi

    Build retention policy works by deleting old builds. When a build is deleted, the associated label is deleted too.

     

    When retention policy is set, we generally use changeset to track the source code. One of the best practice is adding changeset as part of the assembly version number. When a issue is reported against a particular version, you can extract the changeset number and track back to source code.

     

    For how to set changeset as part of assembly version, see this blog.

  • 2008년 9월 30일 화요일 오후 12:47Jason Prickett - MSFTMSFT사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨

    Bill is right. That is our default behavior. However, in SP1 we added the ability to keep your labels. Here is how:

     

    The build admin can add a flag to the Web.config file on the Application Tier to specify that labels should not be deleted. Here is an example of what that line in the web.config file would look like:
    <add key="PreserveLabelsOnBuildDeletion" value="True"/>

     

    You may need to restart IIS to force the use of the new Web.config.


    When this value is present, labels are not deleted from Source Control. The default behavior is still the same as RTM; labels get deleted with their corresponding builds.

     

    Hope that helps,

    Jason