• MohamedG's Log

    Visual GCRoot via DGML

    • 18 Comments
    I was inspired by Lovett 's post about Visualizing Runtime Object Graphs to create my first debugger extension that takes the output of !gcroot and creates a graph that one can interact with easily in Visual Studio 2010. So, what does my extension do...
  • MohamedG's Log

    How to: Move a Shelveset to Another Branch?

    • 10 Comments
    A very handy power tool is tfpt unshelve. It’s capable of migrating a shelveset from a branch to another, it does that by performing a baseless merge, so you will need to resolve the conflicts produced. The syntax of the command looks like the following...
  • MohamedG's Log

    Windows Store App Settings Flyout

    • 9 Comments
    Prerequisites Please read the following articles first: Guidelines for app settings (Windows Store apps) Quickstart: Adding app settings using Windows Runtime In this post, I’ll be walking through how to create a custom UI for settings (required for C#...
  • MohamedG's Log

    Adding Custom SOAP Headers in WCF

    • 7 Comments
    First, you need to decide whether to create the custom header using the MessageHeader.CreateHeader method, or by extending the abstract MessageHeader class. Under the hood, the CreateHeader method returns an instance of an internal class called XmlObjectSerializerHeader...
  • MohamedG's Log

    Merges

    • 6 Comments
    When you would like to know what changes have been merged already between a source and a target you can run: tf merges sourceItemSpec targetItemSpec Usually you would like to view the merge history recursively when you are using folders are branch roots...
  • MohamedG's Log

    Passing C++ Arrays by Value

    • 5 Comments
    Just in case you needed to, you can wrap an array into a struct/class and pass it by value to a function: template < typename T, int N> struct array { T value[N]; T & operator []( int i) { return value[i]; } }; template < typename T, int...
  • MohamedG's Log

    ExtensionDataObject is not Marked as Serializable

    • 5 Comments
    If you use Data Contracts , then probably your classes implement the IExtensibleDataObject interface to allow (de)serialization of different versions of the data contract. I won’t go into details about the use of ExtensionDataObject , the type of the...
  • MohamedG's Log

    Selection of Majority in O(n)

    • 4 Comments
    Selection algorithms are very useful in many instances, like finding the majority. Given an array of size n that contains a majority item (an item that's repeated more than n/2 times), we can find that item in O(n). Basically, we can consider it as a...
  • MohamedG's Log

    How to: Query All Labels on a Folder Recursively?

    • 4 Comments
    To do this, you can't call query labels with a wildcard character, you need to do the following: - Get all items blow $/Dir1 using GetItems - Loop through them calling QueryLabels on each one. Here's a code snippet: VersionControlServer sc = tfs.GetService<...
  • MohamedG's Log

    How to: Receive Daily E-mail Notifications?

    • 4 Comments
    You can receive a daily email that has a compiled list of notifications, but you will need to subscribe programmatically: IEventService eventService = ( IEventService ) new TeamFoundationServer ( "http://tfs:8080" ).GetService( typeof ( IEventService...
  • MohamedG's Log

    TFS Event Subscription Tool

    • 4 Comments
    You can subscribe to get email alerts when certain events occur in a Team Project using Project Alerts. There's another way to subscribe to Team Project events and to configure the subscription too, it's bissubscribe.exe, which can be found on the Team...
  • MohamedG's Log

    Cartoon #6: Public

    • 3 Comments
    public (C# Reference)
  • MohamedG's Log

    How to: Show last changed date for an item?

    • 3 Comments
    If you haven’t already done so, go ahead and install VS 2008 SP1 to show the last check-in date column in Source Control Explorer. You can also view it through the command line if you run tf prop itemSpec and it will show up the last changed date.
  • MohamedG's Log

    Deny: Revisited

    • 3 Comments
    In a previous post , I talked about the deny option and how it’s evaluated. The documentation on MSDN is talking about conflicting permissions on the same level, however, in TFS2008 SP1, permissions are evaluated bottom up and the first match wins. If...
  • MohamedG's Log

    WCF Service Throttling

    • 3 Comments
    Throttling, generally speaking, is tricky. Get the limits low and you may be prone to DoS and clients timing out trying to connect to your service in vain; Get them high and you may end up with an overloaded service that’s eating up machine resources...
  • MohamedG's Log

    Changing the Foreground Color of an Indeterminate ProgressBar

    • 3 Comments
    You would think that the following XAML changes the indeterminate progress bar’s foreground color: < ProgressBar IsIndeterminate ="True" Foreground ="Aquamarine" /> Unfortunately, that doesn’t work. You will need to override...
  • MohamedG's Log

    Adding HTTP Headers to WCF Calls

    • 2 Comments
    To add HTTP headers, request messages have to be intercepted before they are sent to the server. This can be done by implementing the IClientMessageInspector.BeforeSendRequest method: /// <summary> /// Represents a message inspector object...
  • MohamedG's Log

    Test Patterns

    • 2 Comments
    Just like design patterns, the use of test patterns will make your life easier. A lot of the common testing methods can be reused. Along with the benefits of reuse, using patterns makes it easier to explain to others what you are going to do in a word...
  • MohamedG's Log

    Pitfalls of Baseless Merge

    • 2 Comments
    A previous post was dedicated to show the benefits of a baseless merge, this one shows the pitfalls: When you perform a baseless merge, renames and deletes will not be merged If you get conflicts, the usual 3-way merge is not possible, you will have to...
  • MohamedG's Log

    How to: List Changes in a Shelveset?

    • 2 Comments
    When you run tf shelvesets shelvesetName /format:detailed you get the shelveset’s name and some metadata associated with it, but not the changes. To get a list of the changes in a changeset, run: tf stat /shelveset:shelvesetName;DOMAIN\ownerUserName The...
  • MohamedG's Log

    How to: List Changesets Between Two Labeled Versions?

    • 2 Comments
    You can achieve that behavior by running: tf hist rootItemSpec /r /version:LstartLabel~LendLabel Here’s my scenario: tf hist /i File.cs Changeset Change User Date Comment --------- -------------------------- ------------- ---------- -------- 65 edit mohamedg...
  • MohamedG's Log

    How to: Copy Workspace Mappings?

    • 2 Comments
    A common scenario that you may see is the need to share/sync workspace mappings amongst team members. A developer adds a new dependency in a certain project and changes his/her mappings to get this library, and everyone else in the team now needs to do...
  • MohamedG's Log

    Handy Tips for tf.exe

    • 2 Comments
    Using tf.exe gives you more options and more control, here are some tips that might come handy: For item specs: You can use wildcards with most of the commands Just like most command-line apps, you can supply relative path parts (like . and ..), you can...
  • MohamedG's Log

    How to: Change TFS Temp Folder?

    • 2 Comments
    TFS uses a temp folder to get files that you view. The location of that folder is %TMP%\TFSTemp. It’s not configurable via TFS, tf.exe, or Visual Studio. However, you can just set the TMP environment variable. Simply: set TMP=D:\Temp set TEMP=%TMP% md...
  • MohamedG's Log

    How to: Use tf merge /discard?

    • 2 Comments
    In a previous post , I mentioned some details about merge history bookkeeping. In a nutshell, when you merge, you are giving credit to the target branch for the range of versions you’re merging over. That’s why you see the merge change type pended on...
Page 1 of 5 (117 items) 12345