Adapt to .Net 4.