Archive for category Visual Studio

Undo checkout for unchanged files in TFS 2010

This is a really annoying one- I’ll often open files and not make any changes, but perhaps hit save out of habit making TFS check the file out. It will then hang about in pending changes until I manually go through the entire list checking each file for changes, only for TFS to helpfully inform me the files are identical! If you have TFS power tools you can run the following from a command line (having cd’ed to your solutions directory);

tfpt uu /recursive /noget

This will check all files and ask if you wish to undo checkout for identical files. Simples. But even simpler.. I found this article on Antoine Aubry’s blog detailing how to create a menu item in visual studio making this impossibly easy!

The balls of it (incase the site ever disappears!) is to go to tools> external tools> and then add a new item with the following configuration;

Title &Undo fake changes
Command %windir%\System32\cmd.exe
Arguments /C echo y | “%ProgramFiles(x86)%\Microsoft Team Foundation Server 2010 Power Tools\TFPT.EXE” uu /recursive /noget
Initial directory $(SolutionDir)

1 Comment

Import & Export break points in Visual Studio 2010

“This will change your life”

… reassured my colleague Mr Carmicheal.

Basically it’s possible in VS2010 (Pro, Premium or Ultimate) to Import & Export sets of break points for projects, handy if you have pieces of code you often have to step through for some reason or another.

The original article can be found here: http://msdn.microsoft.com/en-us/library/dd293657.aspx

In case that page goes AWOL as MSDN pages often do, this is what it said;

To export all breakpoints that match the current search criteria

  1. In the Breakpoints window toolbar, click the Export all breakpoints matching current search criteria icon.

    The Save As dialog box appears.

  2. In the Save As dialog box, type a name in the File name box.

    This is the name of the XML file that will contain the exported breakpoints.

  3. Note the folder path shown at the top of the dialog box. To save the XML file to a different location, change the folder path shown in that box, or click Browse Folders to browse for a new location.
  4. Click Save.

To export selected breakpoints

  1. In the Breakpoints window, select the breakpoints you want to export.

    To select multiple breakpoints, hold down the CTRL key and click additional breakpoints.

  2. Right-click in the breakpoints list, and choose Export selected.

    The Save As dialog box appears.

  3. In the Save As dialog box, type a name in the File name box.

    This is the name of the XML file that will contain the exported breakpoints.

  4. The folder path is shown at the top of the dialog box. To save the XML file to a different location, change the folder path shown in that box, or click Browse Folders to browse for a new location.
  5. Click Save.

To import breakpoints

  1. In the Breakpoints window toolbar, click the Import breakpoints from a file icon.

    The Open dialog box appears.

  2. In the Open dialog box, browse to the directory where your file is located, and then type the file name or select the file from the file list.
  3. Click OK.

1 Comment

Quickly Find/ Open a file in Visual Studio

I’m working on some massive solutions containing loads of projects at my new place and frequently have to shoot between different source files scattered all over- A colleague recently showed me a really quick way to find and open files- from the Find bar in the top ‘standard’ menu bar, you can type ‘>of’ followed by the name of the file you are after and it will bring up an auto complete menu letting you select and open the file.

No Comments