How to: Identify Blocked SQL Processes Quickly

There was a great article in Visual Studio magazine (June 2008) by Ian Stirk in which he talks in detail about how to improve application performance by creating a utility that tells you which processes are being blocked. You can read the article at The two sql sprocs that you will need to create…


Running a Windows Service from command line

One of the common problems that we face in designing a Windows service is the ease of debugging it. I have followed a pattern to solve this problem where I can run a service from either command line or as a service.   The steps below outline the changes you would need to make to enable…


How to AutoIncrement version with each build using Team Foundation Server build (with a little help from AssemblyInfoTask)

One common requirement with any decent sized multi-version product is to automatically update the version numbers of the binaries on a regular basis. This is generally achieved by updating the AssemblyInfo.cs (or other language equivalent ) files.   There are a couple of ways to do this: 1.       Assign one developer to remember to increment…


Visual Studio Setup/deployment projects and Team Foundation Server

Team Foundation servers use MSBuild to build our projects. MSBuild does not support the Visual Studio Setup/Deployment projects natively. In many of today’s applications it’s a must to have msi based installs created via Visual Studio. Till someone actually takes the time to build a custom task library to handle vdproj files in MSBuild, we…


Handling global web service unhandled exceptions

One of the most tiresome (but important) things when developing web services is handling un-handled exceptions. A good design principle forces you to catch and cast relevant exceptions raised by your web methods into more meaningful SOAP exceptions. But exceptions will occur. It is quite tedious to wrap each web method in a try/catch loop….


Bulk Insert into SQL from C# App

One of the common problems I have seen is to bulk upload data to a SQL Server database. If you have the flexibility to directly run your code in SQL, you have a ton of options. But let’s say that you have to massage the data before you throw it in to the database, then…