Semiconductor elements with metal film contacts are built into a housing and after assembly but before sealing the housing is exposed to a vacuum of less than 1 mm. Hg pressure and/or heated to a 100 degrees C. The assembly is then cooled in the vacuum or a protective gas and then directly afterwards the housing is sealed vacuum tight. During the heating the units may be flushed with inert gas.