TFVC code review in Visual Studio
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
Visual Studio 2019 | Visual Studio 2022
You can use Visual Studio to request code reviews, respond to review requests, and suspend and resume work for Team Foundation Version Control (TFVC).
If you're using Git source control instead of TFVC, use a pull request for code reviews.
Note
Visual Studio My Work and Code Review features are available with the following editions:
- Visual Studio 2022: Visual Studio Community, Visual Studio Professional, and Visual Studio Enterprise
- Visual Studio 2019: Visual Studio Professional and Visual Studio Enterprise
Prerequisites
Before you ask for a code review, make sure you've shared your code in TFVC.
Request a code review
Before you check in code, you can use Visual Studio to ask someone else from your team to review it. Your request appears in the recipient's Team Explorer window on the My Work page.
To request a code review, before you check in a change:
Go to the My Work page in Team Explorer.
On the My Work page, select Request Review.
On the New Code Review page, enter the reviewer name or names and a subject for the code review, and then select Submit Request.
You can suspend your work so you can work on something else while you wait to hear back from the code review. On the My Work page of Team Explorer, select Suspend in the In Progress Work section, optionally enter a different name for the suspended work, and then select Suspend.
Respond to the code review request
Requested reviewers see the code review request in Team Explorer, look at the changes, and give their feedback. To respond to a review request:
On the My Work page of Team Explorer, locate the review request.
To open the code review, double-click the request, or right-click it and select Open.
From the Code Review page, you can select the changed files to review the differences.
To add comments, in the difference window, select the code to comment on, right-click, and select Add comment. You can also press Ctrl+Shift+K.
Select Send Comments to send the comments.
You can get email alerts for code reviews, too. To sign up, select Project Alerts under Team Project on the Settings page in Team Explorer.
Update the code based on the review feedback
When you get the code review results, you can resume work on the project.
On the My Work page in Team Explorer, select Resume under Suspended Work.
Your changes are unshelved and the windows you had opened are restored, so you can incorporate the review feedback.
On the Code Review page, you can close the review by selecting Close Review and then selecting Complete if the review is finished, or Abandon if you don't plan to finish it.