Adapting to .Net 4.0 Framework