TFS work items tips

We started  using TFS to track requests using Work items.

1. Telerik‘s  TFS Work Item Manager (beta version for TFS 2010 is available) that could be interesting to use instead of standard VS2010, especially for someone who doesn’t want to have VS installed on their machine.(thanks to dimarzionist who pointed to the tool).See also TFS Project Dashboard

2.Visual Studio TFS work item attachments Tab

I’ve found that Outlook emails can be dropped to TFS work item attachments. Just open TFS work item attachment tab and drag and drop Outlook email to it.

Also you can copy any selected text and paste it to TFS work item attachments tab. The text will be saved as an attachment file

Unfortunately attachments can be only added or deleted, it will be good to rename them or modify comment as well. Vote for this on MS Connect.

DDD Melbourne -lessons learned

I’ve attended DDD Melbourne and want to list the interesting points, that I’ve learned and want to follow.
To read more:
* Moles-Mocking Isolation framework for .NET. Documentation is here.   (See also Mocking frameworks comparison created October 4, 2009 )
* PluralSight  
ELMAH: Error Logging Modules and Handlers Great for new sites or sites without error logging/monitoring. However if you site already have working error logging/monitoring tools, probably not worth to use ELMAH.
* VS UI Test Recorder -see posts Visual Studio 2010 Coded UI Test User Guide. Note that Microsoft Test Manager (MTM) toolis a separate application, that can be started from Program files/VS 2010 menu.It is not a menu inside Visual Studio.
* CodeContract– seems great in Debug. Will be good if in production  will be possible runtime configuration, ability to log instead of throw exception.
The programmer is free to use the customization provided by Debug.Assert using assert listeners to obtain whatever runtime behavior they desire (e.g., ignoring the error, logging it, or throwing an exception).
// Clears the existing list of assert listener (the default pop-up box)
// Install your own listener
Note that you can’t catch specific ContractException, but can catch generic Exception(see How come you cannot catch Code Contract exceptions?)


Books recommended “Working effectively with legacy code” by Michael Feathers (corresponding article
 Fowler, Martin Refactoring: Improving the Design of Existing Code, slides


Batch file to Delete Old Virtual Directories.

On some servers we have many old Virtual Directories created for previous versions of our application.
IIS user interface allows to delete only one in a time.
Fortunately we can use IIS scripts as described in

How to manage Web sites and Web virtual directories by using command-line scripts in IIS 6.0

I’ve created batch file DeleteOldVDirs.cmd

rem syntax: iisvdir /delete WebSite [/Virtual Path]Name [/s Computer [/u [Domain]User /p Password]]

REM list all directories and create batch of deletes
iisvdir /query “Default Web Site”

echo “Enter Ctrl-C  if you want to stop deleting”
iisvdir /delete “Default Web Site/VDirName1”

iisvdir /delete “Default Web Site/VDirName2”

If the name of WebSite or Virtual directory contain spaces(e.g  “Default Web Site”), don’t forget to use double quotes.
Note that the batch doesn’t delete physical directories from flie system.You need to delete them using Windows Explorer, but it does support multiple selection!