O XmlSerializer criará documentos vazios

Tudo bem, o código a seguir em produção há mais de um ano, sem alterações. Está funcionando muito bem. No mês passado, mais de algumas máquinas relatam que os documentos xml estão completamente vazios. Eles nem sequer contêm um cabeçalho xml. Não consigo duplicar os arquivos que estão subitamente vazios, nem posso sugerir uma maneira de isso acontecer. Espero que alguém tenha tido um problema semelhante que resolveu.

A maioria das máquinas que usam esse código o utiliza há cerca de um ano, se não mais. Os arquivos vazios costumavam ter dados e listas. Os arquivos não serializam ao mesmo tempo. O salvar / serializar um após o outro antes da saída do programa.

Minhas perguntas: é possível que o código abaixo crie um arquivo vazio? O que mais faria com que ficassem subitamente vazios? Alguém mais teve problemas com o XML-serializer no mês passado? (Esse problema ocorreu apenas no mês passado em compilações que ficaram estáveis por mais de 3 meses.)

Se você tiver dúvidas ou falta algo perguntar, por favor. Também existe uma grande variedade de tipos que eu serializo ... então, se você pode imaginar, provavelmente tenho algo semelhante que é serializado.

 public class BackEnd<T> {
 public string FileSaveLocation = "this gets set on startup";
 public bool DisabledSerial;
 public virtual void BeforeDeserialize() { }
 public virtual void BeforeSerialize() { }
 public virtual void OnSuccessfulSerialize() { }
 protected virtual void OnSuccessfulDeserialize(ListBackEnd<T> tmpList) { }
 protected virtual void OnDeserialize(ListBackEnd<T> tmpList) { }

 public virtual void serialize()
    {
        if (DisabledSerial)
            return;
        try
        {
            BeforeSerialize();

            using (TextWriter textWrite = new StreamWriter(FileSaveLocation))
            {
                (new XmlSerializer(this.GetType())).Serialize(textWrite, this);
                Debug.WriteLine(" [S]");
                textWrite.Close();
            }
            OnSuccessfulSerialize();
        }
        catch (Exception e)
        {
            Static.Backup.XmlFile(FileSaveLocation);
            Log.ErrorCatch(e,
                "xml",
                "serialize - " + typeof(T) + " - " + (new FileInfo(FileSaveLocation)).Name);
        }

    }

    public virtual object deserialize(TextReader reader)
    {
        if (this.DisabledSerial)
            return false;


        ListBackEnd<T> tmp = null;


        this.BeforeDeserialize();

        if (reader == null && !File.Exists(this.FileSaveLocation))
        {
            Log.Write(Family.Error,
                "xml",
                "deserialize - " + this.GetType() + " - file not found. " + (new FileInfo(FileSaveLocation)).Name);
        }
        else
        {
            try
            {
                using (TextReader textRead = ((reader == null) ? new StreamReader(this.FileSaveLocation) : reader))
                {
                    tmp = (ListBackEnd<T>)this.get_serializer().Deserialize(textRead);
                    Debug.WriteLine(" [D]");
                    textRead.Close();
                }
                OnSuccessfulDeserialize(tmp);

                if (tmp != null)
                {
                    this._Items = tmp._Items;
                    this.AutoIncrementSeed = tmp.AutoIncrementSeed;
                    if (this._Items.Count > this.AutoIncrementSeed && this._Items[0] is ItemStorage)
                        this.AutoIncrementSeed = this._Items.Max(item => (item as ItemStorage).Key);
                }
            }
            catch (Exception e)
            {
                // this only copies the file
                Static.Backup.XmlFile(FileSaveLocation);
                // this only logs the exception
                Log.ErrorCatch(e,
                    "xml",
                    "deserialize - " + typeof(T) + " - " + (new FileInfo(FileSaveLocation)).Name);
            }
        }
        //{ Log.ErrorCatch(e, "xml", "deserialize" + this.GetType() + " - " + this.FileSaveLocation); }

        OnDeserialize(tmp);

        tmp = null;

        return (_Items.Count > 0);
    }
}

questionAnswers(2)

yourAnswerToTheQuestion