Friday, December 14, 2007

TFS Deployer and TFS 2008

Mitch Denny from Readify made two great tools available for Team Foundation Server last year. TFS Integrator provides Continuous Integration for TFS by registering for check-in events then triggering Team Builds and Dependency Replication. TFS Deployer provides automated deployment for TFS projects by registering for build quality change events then executing associated PowerShell scripts. Both of these tools were developed for TFS 2005.

TFS 2008 has just RTMed and it already includes check-in triggered builds in the box so TFS Integrator is less useful (except maybe the Dependency Replication but this can be done via other methods). TFS Deployer, though, is still very useful in a TFS 2008 environment... assuming you can get it to work.

TFS Deployer was originally developed against the TFS 2005 client libraries and, of course, we've uninstalled VS and TFS 2005 from most of our machines already so Deployer just falls over because it can't find the libraries.

TFS Deployer is not open-source (yet) so I can't fix it myself. However, in a comment Mitch suggests using binding redirects in the TFS Deployer config file to enable TFS 2008 support. Unfortunately he doesn't give specifics.

I decided to drop the TFS Deployer assemblies into Reflector and find the list of TFS libraries it uses so I could write the redirects. I updated the .config file and changed the build quality on some existing builds and happily discovered that it works. If you want to use TFS Deployer with TFS 2008, here is the section to add to the TfsDeployer.exe.config file:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.TeamFoundation.VersionControl.Client" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
      <bindingRedirect oldVersion="8.0.0.0" newVersion="9.0.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.TeamFoundation.VersionControl.Common.Integration" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
      <bindingRedirect oldVersion="8.0.0.0" newVersion="9.0.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.TeamFoundation.Build.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
      <bindingRedirect oldVersion="8.0.0.0" newVersion="9.0.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.TeamFoundation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
      <bindingRedirect oldVersion="8.0.0.0" newVersion="9.0.0.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.TeamFoundation.Client" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
      <bindingRedirect oldVersion="8.0.0.0" newVersion="9.0.0.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>

 Saturday, October 13, 2007

BlogML Contribution

I was hit with trackback spam on my blog some time ago and decided the easiest way to stop it was to disable trackbacks on the site all together. The unfortunate downside to this is that I'm not automatically notified when someone blogs in response to one of my posts. I have to go looking.

Today I found a post by Doron Yaacoby written in August (sorry I took so long) about the Live Space support I added to the BlogML project. As I originally mentioned when I posted about this feature, I was too lazy to code a GUI for it. Thankfully, Doron has written one for us, and in WPF too!

It has been a while since I actually used my Live Space BlogML code to convert my own blog but, in response to Doron's note about comment support, from memory the API exposed by the Live Spaces website for querying blog data does not expose comments. Maybe they've changed the API since. Maybe there's a clever way to screen-scrape it.

Thanks for contributing Doron, and thanks for your kind words about my code too.

 Monday, September 10, 2007

Another DVD to iPod

I have another weekend driving holiday planned in the next few weeks and my fiancee has requested Family Guy episodes on the iPod for the trip. Now that I know how to do it, I figure I better get started because there are a lot of episodes.

This time I decided to try Vrata's suggestion of DVDFab instead of the Videora software I used last time. What follows is a very quick summary of my experience with DVDFab.

Benefits:

  • Does not require separate DVD ripping software.
  • Supports optionally embedding subtitles into the video stream.
  • GUI is very clean and easy to follow.
  • Hasn't crashed yet on Vista x64.

Disappointments:

  • Still insists on running as Administrator.
  • The Platinum version for iPod conversion costs about US$50.

In all other ways DVDFab is similar to Videora. Similar conversion times, same resulting file sizes. Support for multiple devices' resolutions and bit rates.

If you think you'll be converting quite a lot of DVDs to an iPod compatible format, DVDFab is probably worth the price and you can try the fully-functional 30-day trial yourself to be sure.

 Monday, August 27, 2007

Convert DVD to iPod

I have just spend two weeks on holiday and before I left I wanted to transfer some of my DVDs to my iPod Video to keep my fiancee and I entertained whilst traveling to our destination. Unfortunately I didn't really think about this soon enough and didn't have time to get it organised. Now that I'm back home though I've been able to look into it further.

The biggest problem I found with converting DVDs to an iPod suitable format is that the movie studios don't seem to want to allow it. This results in either a complicated list of steps involving multiple tricky applications or purchasing an all-on-one solution from a questionable overseas company. Luckily though, Hanselman recently updated his Tools List for Windows, which included a link to Videora Converters, a suite of video transcoding programs available for free. If Hanselman recommends it and I don't have to provide payment details, it's worth a try.

I downloaded their iPod converter and started following their slightly outdated guide for converting DVDs. I grabbed my Futurama box set and put the first disc in. The first stage involves using the getting-harder-to-find DVD Decrypter to rip and decrypt the appropriate video and audio stream without all the extra DVD menu junk. Thankfully I'm familiar with DVD Decrypter and even more so that it works fine as non-admin in Vista 64-bit.

The second stage involves installing and running the Videora software, selecting the file that DVD Decrypter produced and waiting for it to convert the MPEG-2 data to Apple's particular MPEG-4 format. This took less than 10 minutes on my Core 2 Duo to convert a 22-minute animated episode into a 137MB MP4 file. When complete, the video played well in the PC QuickTime player and after using iTunes to transfer it to my iPod it played great there too.

Sadly, while the Videora software is free and written in .NET too, it suffers from two major problems. Firstly, it is so filled with advertising in the program itself that it's hard to see where to start and I began to wonder if I'd just voluntarily installed malware. Secondly, the software is designed to run as an Administrator, trying to write configuration data to Program Files, and under Vista, even as an admin, it crashes hard on exit.

Ultimately, if you want some favourite DVD movies or episodes on your iPod, this is probably the easiest way.

 Tuesday, July 31, 2007

ArgumentNullException: No Message Required

I have been encountering code recently that bugs me. Many methods in classes are testing their arguments for null/Nothing and, if true, throwing a new ArgumentNullException. So far, all good. However, the constructor for the new ArgumentNullException is being passed both the name of the argument and also a message string of the form "_paramName_ cannot be null".

This is totally redundant. The exception being thrown is an Argument *Null* Exception. That about sums it up. Also, if the constructor is passed the parameter name only the message defaults to "Value cannot be null".

Providing a message for an ArgumentNullException requires extra typing, requires maintaining the argument name in three places if it gets renames, and violates FxCop rule CA1303.

Thankfully it turns out it isn't fellow team members doing it. Developer Express' Refactor Pro has a "Create Method Contract" refactoring that is putting the message in.

 Monday, July 02, 2007

Death, Taxes and Software

Tax Calculator The new 2007/2008 financial year has begun and as promised the Australian Taxation Office released the latest version of their e-tax software on July 1st. As I have for the past several years, I downloaded and installed the software and have started entering my income and deductions for the last 12 months.

When the official paperwork arrives, I'll confirm all my figures and submit my tax return electronically and receive my rebate usually within a week, deposited directly to my bank account. Considering the complexity of the income tax system, the software is excellent for non-accountant-types to complete their own tax return.

Unfortunately, e-tax 2007 is still stuck in the obsolete Windows administrator user world. Installation defaults to "c:\etax2007\". It has been over twelve years since Windows 95 was released and the standard was set for software to install into Program Files.

A single e-tax installation on a PC allows multiple people to fill in and submit their tax return, saving their work in progress locally until it is ready to send. However, the software assumes the user is an administrator and writes the *.tax progress file to the installation folder instead of Documents & Settings.

At several stages throughout the questionnaire, summaries and important details are presented to the user with a recommendation to print the information. However, the software always uses the default printer with the default settings, offering no dialogs, and only picking up changes to the default printer after restarting the software.

One of the biggest reasons why e-tax is so great is because the questions are presented in easy to understand language. Whenever more detail is required there are always hyperlinked keywords or a help button leading to a more extension definition with examples. Sadly, it's all useless under Vista because they've stayed with the deprecated WinHelp format for the documentation.

Lastly, for users of Apple computers (and presumably other OSes), the official solution is to use virtualization. I wonder if the purchase price of VMWare or Parallels and a Windows licence can be claimed as a cost of preparing the tax return.

By all appearances e-tax is a full Win32 application, probably written in C++ at first glance, and is expected to continue in that style for the majority of users next financial year too. Perhaps by 2009, they will have moved to a web-based client, which will open the system to non-Windows users but probably introduce other problems along the way.

 Wednesday, June 27, 2007

Ecstatic About NStatic

Ecstatic MascotWesner Moise is getting ever closer to public release of his very promising NStatic static analysis tool for .NET. In general static analysis tools are very expensive but as part of Wes' plans, a lower price to achieve market penetration is most likely. In fact, until he finds a suitable publisher he expects to selling independently for a few months, during which time we might be lucky to pick it up for a "bargain" price.

So far I think NStatic only supports C# 2.0 but there are plans to add support for C# 3.0 features and maybe VB.NET too if the demand is there. I, for one, sure hope that VB support becomes a reality, I think our current suite of software could really benefit from some in depth analysis.

Keep a close eye on Wesner's blog for the latest information.

 Friday, June 22, 2007

Feature Suggestion For DotNetKicks

DonkeyGavin Joyce announced a few months ago that the DotNetKicks community website will be going open source. Gavin has since created a DotNetKicks project on Google Code with some placeholders and has asked for people interested in contributing to join. One thing that isn't clear is whether the engine will be open source for others to build their own sites or if all the updates will get deployed back to DotNetKicks.com.

Regardless, I already have one idea in mind. In a moment of complete clumsiness, while trying to quickly submit a post to DotNetKicks before going to bed, I associated the wrong Title and Description with the wrong Url. Unfortunately, even though I had submitted the item, I was unable to correct the Title or Description and I was unable to delete the submission altogether and start again. I unkicked the post back to zero kicks but that didn't help.

My suggestion therefore, is that the submitter of an article should be able to delete that submission. Perhaps, to be safe, it could be restricted to only allow deletion if no one else has kicked it.

Until then, I'll just have to live with looking stupid for my story on DotNetKicks which, strangely, someone other than me has kicked anyway.

 Wednesday, June 06, 2007

ReSharper And Other Trivia

As Jim has recently explained, ReSharper 3.0 is now available in beta and for the first time supports VB.NET. As the majority of the code I work with each day is VB, I have, also for the first time, installed ReSharper. I am enjoying the experience so far and it works well across both VB and C# projects in the same solution.

However, as I've mentioned before, I use C# projects to test VB production code and ReSharper was failing to consider InternalsVisibleTo attributes and incorrectly marking code in my unit tests as erroneous. Thankfully Visual Studio still built and executed the code fine. Also very impressive was how quickly the guys at Jetbrains had solved the bug once I had emailed them. Try the nightly builds here for the latest version.

As a side note, if you're working with the InternalsVisibleTo attribute, you may find fellow Australian developer David Kean's generator very useful for extracting the rather long assembly PublicKey.

Now, if I can just convince ReSharper to give back my F12 key.

 Monday, June 04, 2007

Capture To Team Foundation

Dudu Shmaya has just released a plugin for Cropper to create TFS work items from screen captures. You can also use it to add screen capture attachments to existing work items. We already use both Cropper and TFS, and this new plugin should be very useful for creating bug reports.

Dudu says he plans to submit the source code for his plugin to the CodePlex project for Cropper plugins soon. Looks like there are some other nice plugins already on their too.

 Sunday, May 06, 2007

Preaching To The Converter

During the past week I have managed to transfer my posts from my Live Space to this new Das Blog site. It was pleasantly trouble free, due mostly to the hard work having been already done by the BlogML team.

The biggest headache was the limitation of the Live Space MetaWeblog API implementation. The API will only allow you to retrieve the most recent 20 posts or, if you know the postId, one post at a time. Unfortunately there is no supported method for retrieving the postIds beyond the most recent 20.

Luckily, upon inspection of the nature of the postIds on my Live Space, and inspection of the Live Space Team's blog for confirmation, I discovered a predictable pattern to the postId. It consists of a unique hex string for the space, and an exclamation mark followed by a decimal number that increments with each new post.

With this information I was able to write a Live Space to BlogML converter that, while not exhibiting amazing performance, is able to retrieve all posts on a Live Space much easier than doing it manually or by screen-scraping.

My currently one-way Live Space converter is available in ChangeSet 21935 and later of the BlogML project on CodePlex. Hopefully the project coordinators will build a new release soon and it will then be available as part of the main package.

To use the converter, start by enabling email publishing on your Live Space. Then create a new Visual Studio project and reference the LiveSpace.BlogML assembly. Construct an instance of the LiveSpaceBlogMLWriter passing the name of your Live Space and your email publishing secret word. Optionally set the PostCount property to a number ideally no greater than the number of posts on your site. Finally, call the Write method passing a preconfigured XmlWriter as the destination.

Please submit any issues you have with the converter to the BlogML Discussion pages and I'll endeavour to solve them. For those without the resources or inclination to write a program as mentioned above, let me know and I'll find some time to create a user interface for it.

UPDATE: Doron Yaacoby has created a GUI for the Live Space BlogML converter.

 Wednesday, May 03, 2006

Deblector arrives

Felice Pollano has just released the first version of the new Deblector addin for debugging within Reflector. It's only alpha at the moment and has some obvious bugs but it is very promising. In the past I have looked at having a Virtual PC with a hacked rebuild of the core framework with debugging enabled. Now I can step into framework code just as easily within the familar Reflector interface. I don't have much experience with IL so I was a little confused at first when multiple lines of IL seemed to execute at once but I quickly realised they all applied to method call setup. I suspect, if possible, we may even be able step through the framework viewed in our chosen language. Keep an eye on this one.
 Sunday, April 23, 2006

Request to dock

One of the nice parts of working with the Visual Studio 2005 IDE is the very well implemented window docking system. It now looks like there is a library available to achieve the same results in our own applications:

Deblector

Lutz Roeder... you're the bomb. I've been using .NET Reflector for quite some time now and I love every bit of it. If you aren't using it yet, go get it. However, there is one thing I've always wanted to do with Reflector, use it to debug code. As I recently discovered on Mike Stall's excellent debugging blog someone is working on integrating debugging into Reflector. That someone is Felice Pollano and hopefully Deblector will soon become one of my primary development tools too.
 Sunday, February 19, 2006

The Thermometer Of Success

While I am now doing some serious .NET work I am finding myself blogging more about non-programming topics. I subscribe to many RSS feeds, including the aggregation provided by .NET Developers Blog. I read a post yesterday by Andre Cruz about software for monitoring system temperatures.

 I was accustomed to this kind of system monitoring software being provided with the motherboard drivers for all my desktop computers but my laptop did not include anything like this. Looking at the laptops of different brands used by my colleagues this seems to be a common oversight by laptop manufacturers.

Thankfully, the MobileMeter software mentioned in the blog provides the perfect solution. It utilises ACPI to display all the temperatures available from the system which includes processor and hard drive on my laptop and also several others on other laptops. It also shows current processor speed (I was surprised how low it drops on some of my battery power modes) and even the current battery charge or discharge rate in Watts.

The best feature however is that I can not only set the MobileMeter window to be always on top and very transparent, it will also allow all mouse operations on the window to pass through to underlying objects as though the window wasn’t there at all. This is the best system tool I have encountered since Sysinternal’s Process Explorer.


 Sunday, June 26, 2005

Mind your ODBC

I have planned to post about MYOB's developer support for some time and I was provoked by one of Clarke Scott's recent blogs to do it now. I have been working with a wholesale company to automate the export of data from their MYOB Premier company file to their website on a regular basis. They want their customers to be able to access current pricing and stock levels of all the products they distribute, and they want their customers to be able to view current back orders and recent invoices online.

I have done plenty of work like this before for non-MYOB accounting systems and even MYOB RetailManager (which conveniently uses a Microsoft Access database). Unfortunately, every other MYOB product uses a proprietary database format, which, at the time I started this job, required the customer to pay $259 Australian per company file for an ODBC driver. The ODBC driver was read only and was incompatible with ADO.NET in certain situations. For documentation on the MYOB table structure, some code samples and three months forum access, MYOB Australia expected the developer to cough up around $900. I discovered however that MYOB USA provides table structure documentation (the "Data Dictionary") for free download from their website. A few tables have slightly different names and some tax related items are different but it is mostly identical to the Australian MYOB system. I decided to call MYOB Australia about this situation and their response was basically, "that's the way it is, live with it".

Thankfully, in the last three months, MYOB Australia has improved their support for developers. They now provide the Data Dictionary, sample code, and tools for free download from the website. The ODBC driver has been updated and has hopefully been improved but I have not tested the ADO.NET problems yet. MYOB also have an excellent Developer Partner Program now. For just under $700 per annum you get an ODBC driver with write access, full access to MYOB's email and forum support, and your customers can use the ODBC driver with their company file free.

If you are working with MYOB, or plan to, the partner program is excellent.