dotnet thoughts 

a dotnet developer's technical blog

How to do Rollback of a change set in TFS 2010

TFS 2010 provides you the ability to Rollback or Undo a ChangeSet from TFS 2010 itself. You can also see it as a new pending change type as Rollback (new change type in the history) inside Team Explorer.

You can more information in MSDN : Rollback Command (Team Foundation Version Control)

If you want to rollback you change 123, you need to do some thing like

cd c:\Code\you must useProjectName
tf rollback /changeset:123

Debugger Canvas

Debugger Canvas is an excellent debugging tool which will be introduced into Visual Studio by early next month. From Offical description – Debugger Canvas pulls together the code you’re exploring onto a single pan-and-zoom display. As you hit breakpoints or step into code, Debugger Canvas shows just the methods that you’re debugging, with call lines and local variables, to help you see the bigger picture. It will require Visual Studio 2010 Ultimate SP1 (or the trial version).

You can get more information about Debugger Canvas from here and here also.

Here is a demo video about Debugger canvas.

How to get stack trace programmatically in C#

Stack information is very helpful to debug programs; this snippet will help to get stack trace. This is using System.Diagnostics namespace.

StackTrace stackTrace = new StackTrace();
StackFrame[] stackFrames = stackTrace.GetFrames();
foreach (StackFrame stackFrame in stackFrames)
{
    Console.WriteLine("Method name : [{0}]", stackFrame.GetMethod().Name);
}

Happy Debugging :-)

Native HTML5: First IE10 Platform Preview Available for Download

IE10 Platform Preview 1, available for download today is the first step in delivering the next wave of progress in native HTML5 support. Web sites and HTML5 run best when they run natively, on a browser optimized for the operating system on your device.

More details here

Changing the diff program used by Visual Studio

You can configure your own diff program, instead of the default diff program provided from Microsoft for comparing two files. In this post I am using Beyond Compare.

  1. Open Visual Studio 2010
  2. Select Tools > Options menu.
  3. Select the Source control Tab in the left side.
  4. Source control options in Visual Studio options

    Source control options in Visual Studio options

  5. Click the “Configure User Tools” button in the right pane. It will popup a Configure user tools dialog like this.
  6. Configure user tools dialog

    Configure user tools dialog

  7. Now you are ready to enter the configuration for whichever tool you choose to use. Below is the settings for Beyond Compare.
  8. Settings for Compare tool

    Settings for Compare tool

  9. Here is the settings.
  10. Extension: .*
    Operation: Compare
    Command: C:\Program Files\Beyond Compare 3\BC2.exe [replace with the proper path for your machine]
    Arguments: %1 %2 /lefttitle=%6 /righttitle=%7

Happy programming :-)

Here is a detailed post regarding diff/merge configuration in Team Foundation – common Command and Argument values from James Manning.

Older Posts »