Symbol Server Transaction Manager
Part of the recent Mastering .NET Debugging course I took covered setting up and using Microsoft’s Symbol Server technology – something that’s been around for a while, but yet many people don’t do it. While it’s incredibly useful to have a symbol server set up to contain operating system symbols (the LAN is faster than the web), it can also be useful to place your own builds on the symbol server, especially for larger or distributed teams. And, it’s trivially easy to set one up, since it’s just a file-based database all you need is an available shared directory with plenty of space. Microsoft includes the “symstore” utility which allows you to add your own symbols – it’s included with the Debugging Tools for Windows download–the same download that includes Windbg.
It’s easy to upload your builds to the symbol server using the command line. You execute a command like:
symstore add /r /f d:\builds\*.* /s \\symbol\ProductSymbols /t "Product Name" /v "Version string" /c "Comment"
(For full usage information run “symstore” with no arguments.)
The not-so-easy part of this process comes when managing previously uploaded versions of your symbols. John Robbins suggested (and who am I to resist a challenge) that it would be great if somebody wrote a tool with some sort of UI that allowed users to select previous “transactions” and delete them. The only way to do that right now is by manually scanning the “history.txt” file located on the server’s share (in an “000admin” subdirectory) and pulling out the transaction id to delete by using in a “symstore del” command.
Way, way too manual.
So, dear reader, I give you my response to John’s challenge: Symbol Server Transaction Manager!
UPDATE 1/4/2008: I’ve done a huge overhaul of the app, and released it as open source on CodePlex as the PSSymbolStore project. Download the latest release there.
It makes the process much easier, I hope. Simply start the app, and press CTRL+O to open a symbol store. Note that in all my examples I’m using a local symbol store, “C:\symbols” — but in most cases you’ll be specifying a network path such as “\\symbols\ProductSymbols”.
Once you’ve opened a symbol store, you’ll see a list of existing transactions. Any transactions that have previously been deleted will not be shown. You can sort by any of the columns to help find the transactions you are looking for, such as all transactions older than 2 weeks.
At this point, it’s as easy as highlighting the transactions you want and pressing “Delete”. Or you can right-click one or more items and use the context menu. If you haven’t refreshed your view (I didn’t code it to auto-refresh because of how long the operation might take), and try to re-delete a transaction, you’ll see an error message in red. In fact, any error will be shown in red. If you come across an error condition that shows up in blue (which indicates success), let me know.
That’s about it, pretty simple stuff, eh? There is one thing worthy of a special note. Because deleting transactions can be a fairly long-running operation, you can cancel it. The “Delete” button changes to “Cancel” if an operation is running. If you click “Cancel”, it will kill the currently executing instance of SYMSTORE, orphaning any remaining files in the transaction, and it won’t process any more transactions, if you had selected more than one. That’s just something to be aware of. Eventually maybe I’ll be smarter about cleaning up the files, but for now, cancel at your own risk. 🙂
I welcome any feedback, if you find this tool useful, let me know! I’m happy to add any enhancements you can think of, too.