I've been experiencing some problems working with the XmlSerializer class (from .net framework v2.0).It appears that when using XmlSeializer to serialize a class XmlSerializer will create a dynamic assembly on the fly containing the serialization code.The problem is that this assembly is never collected by the GC since assebmlies cannot be unloaded once they have been loaded in memory.Looking at the code (using reflector) you can see that XmlSerializer maintains a cache of temp assemblies in order to speed up performance and save some memory space.This is acceptable only that unfortunately only some constructors use this cache, other constructors choose from unobvious reason to bypass this mechanism.Specifically the constructor that accepts a Type and a string parameter uses this mechnism.The constructor that accepts 7 parameters bypasses this mechnism.