Fix build for NET35 and NET40