0

Basically, to prevent conflicts, I want visual studio to warn me if I'm checking out a file but I don't have the latest server version. Currently, it lets me check the file out with no notification, message, or warning. Is this possible to do?

Visual Studio Pro 2015 (14.0.25422.01 U3)

Jason
  • 808
  • 6
  • 25

1 Answers1

1

You can achieve that by configuring the checkout settings:

  1. In Team Explorer, select and connect to the team project for which you want to configure check-out settings.
  2. Click Settings in Home page
  3. From the Setting menu, under Team Project click Source Control.
  4. In the Source Control Settings dialog box, select the Check-out Settings tab.
  5. Select the Enable get latest on check-out box.
  6. Click OK.

Thus it will prompt you to select the latest (server) version when you check out file for edit.


UPDATE:

You don't need the "AdminProjectRight", just have the Edit project-level information permission set to Allow. See Configure Check-Out Settings. So, you can ask the admin to set the permission if possible. There isn't a way to set the warning locally, it's project level setting. It needs connecting to TFS to check whether the local version is the latest or not.

Actually you can see that if the local version is not the latest version, then the latest cloumn should be "No". So, you can get latest first then check out for edit.

Another workaround is writing a script with tf get command,then auto run the script periodically, thus the local version will always be the latest version. See below articles to set the auto run task:

enter image description here

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • I'm not able to do this since I don't have "AdminProjectRights" for the project. Is it possible to do it only locally or is this solely a project-wide setting? – Jason Dec 04 '17 at 17:45
  • @DownvoteMe You don't need the "AdminProjectRight", just have the **Edit project-level information** permission set to **Allow**. So, you can ask the admin to set the permission if possible. There isn't a way to set the warning locally, it's project level setting. It needs connecting to TFS to check whether the local version is the latest or not. – Andy Li-MSFT Dec 05 '17 at 02:49
  • I followed your "Configure Check-Out Settings" link and the page had a link at the bottom which led to https://msdn.microsoft.com/library/bb385989 . I followed the steps there which does exactly what I wanted. Steps: Controlling Check-Out Behavior for Your Computer The following procedure controls the check-out behavior for your computer. This affects all Team Foundation Server clients that are installed on your computer. This includes the tf.exe command line utility and third-party client software. To enable or disable get latest on check-out for your computer: (cont) – Jason Dec 05 '17 at 22:10
  • From the Tools menu, click Options. In the Options dialog box, expand Source Control and select Visual Studio Team Foundation Server. Select or clear the Get latest version of item on check out box. Click OK. – Jason Dec 05 '17 at 22:10