Backported to .Net 3.5.