Shifter has been updated. It supports constructor, field, property and method injection now. Alot of work needs to be done still, though. I will continue my work and make some examples. Documentation needs to be made also but who likes documenting?

This evening I tried to connect to my TFS server. But there was a problem. Why? I thought. It was working last night. Luckily I found the problem after a little while. I want to share my solution with you because when I searched the internet I found a ‘solution’ that did not work. This solution wanted me to add the TFSService account to ‘C:\Users\All Users\Microsoft\Crypto\RSA\’. Maybe a solution to a problem but not mine.

But let me begin at the beginning. When connecting to my TFS server I got the following error message: TFS30059: Fatal error while initializing web service. Look at the picture below:

   

The error message is clear. It should be easy to solve it. I googled to see what the solution to the problem was. As I mentioned before  I found some posts to change the security settings of the RSA folder and add the TFSService account. I tried it but it did not work. I started to look for a solution on my own. I tried IIS. Maybe it was offline or maybe the Team System Server webserviceswere offline. No, that was not the case. Then I thought that the Team System databases could be the problem. So I tried to connect to my Sql Server instance. I could not connect and I got the message to look at the configuration withthe ‘Sql Server Configuration Manager’ (see the picture below). On the Service tab I saw the problem. My Sql Server instances were offline. I restarted them and all was fine. :^)

 

Not so long ago I heard that it was impossible to unshelve a shelveset from the branch it was shelve on to a different branch. It is the way Team Foundation Server (TFS) works I was told. And indeed it is the way tfs works out of the box. I asked a colleague and he researched it and gave me the same message:  you cannot do it. He is right but I was not satisfied. I needed to find a solution. I either would write it myself or I would find an existing tool. And I found it. It can be done and the way to do it is with the unshelve command of the powertools for tfs.

The commandline of the unshelve command of this tool is:

tfpt unshelve – Unshelve into workspace with pending changes

Allows a shelveset to be unshelved into a workspace with pending changes.
Merges content between local and shelved changes. Allows migration of shelved
changes from one branch into another by rewriting server paths.

Allows changes from an already-unshelved shelveset to be undone, cleaning
up pending adds, and preserving other existing pending changes in the
workspace.

Usage: tfpt unshelve [shelvesetname[;username]] [/nobackup]
                              [/migrate /source:serverpath /target:serverpath]

 shelvesetname           The name of the shelveset to unshelve
 /nobackup                 Skip the creation of a backup shelveset
 /migrate                    Rewrite the server paths of the shelved items
                                 (for example to unshelve into another branch)
 /source:serverpath     Source location for path rewrite (supply with /migrate)
 /target:serverpath      Target location for path rewrite (supply with /migrate)
 /undo                        Undo pending changes from an unshelved shelveset
 /batchsize:num          Set the batch size for server calls (default 500)

 

Yesterday I discovered  a podcast about Team Foudation Server (TFS). It’s called Radio TFS and it can be found here. The hosts are Paul Hacker, Mickey Gousset and Martin Woodward. They are all Team System MVPs.

Paul Hacker is involved with TFS Times, also. TFS Times is kind of newspaper about TFS with technical information. Mickey Gousset started Team System Rocks. Martin Woodward is a senior software engineer for Teamprise .

I have listened to the first four episodes and it sounded very good. The podcast is presented very well and contains lots of good technical information. You must listen to it!

 

Note: I blog about TFS here, also.

Debugging helps to understand how code works and what causes a bug. But it is not always easy to debug an application. Stepping into a method with parameters, for instance, can be difficult because you will first step into all the properties that are passed as arguments. You solve this problem by jumping to the definition of the method, setting a breakpoint in the method and pressing F5. You can use ‘Run to cursor’ also, of course. But if you have control over the source code you can use the DebuggerStepThroughAttribute to prevent the debugger stepping into the properties.

 The DebuggerStepThroughAttribute does not mean anything to the compiler. It is only there for debuggers. You can mark a method, a constructor, a class or a struct with it. The debugger will not step into the decorated construct. You can still set a breakpoint in marked constructs.

In this post I want describe the manners in which Visual Studio.Net shows information of object instances in the several variable debugger windows; the Autos, Local and Watch windows. To support the post I have placed images of the source code and several variable debugger windows at the end of the article.

Normally Visual Studio.Net shows variables in the debugger windows as a node representing the type with only the type name in the Value column (see below). This can be useful but in general you want more information about the value of the attributes of the class. Especially if the node is folded. Fortunately, the. NET framework gives a developer an opportunity to manipulate the information shown contained in the Value column. This can be done by overriding the ToString() method of a class or by annotating the class with the DebuggerDisplayAttribute.

Visual Studio.Net uses the ToString() method to fill the Value column. Hence, the type is shown. By overriding the ToString() method a developer can change the value in the Value column. Look for an example at the images below.

A developer can use the DebuggerDisplayAttribute when overriding the ToString() method is not suitable. As you can see in the code the DebuggerDisplayAttribute accepts a string which indicates how and what data should be shown. In the string can contain the {} braces. The text between the braces is evaluated to a field, property or method. Locals, pointers and aliases can not stand between the braces.

The DebuggerDisplayAttribute can be used on:

  • Classes,

  • Structures,

  • Delegates,

  • Enumerations,

  • Fields,

  • Properties,

  • Assemblies.

The Type property can be left blank if no type information is required to be shown. The Name property can contain the string that indicates information that should be shown: the string with the {} braces. The Target is used to register the type on which the attribute applies when it is defined at assembly level.

kick it on DotNetKicks.com

 

The code:
 
 
 The standard view
 
The view with ToString() overridden
 
The view with the DebuggerDisplayAttribute

With code snippets software development with Visual Studio.Net 2005 and 2008 can be alot easier. Creating snippet can be done with any text editor. It is just xml. But using a tool is much easier. Snippy is a such a tool.

   Snippy screenshot

  kick it on DotNetKicks.com