serialize wrapper for dll-loaded classes