CodeAccessPermission permission = new InteropPermission(InteropKind::ClrInterop); ; permission.assert(); // потом код new()