Is there any known trap not to fall when executing .NET applications?
It is a known fact that the .NET garbage collector (implementation is owned by Microsoft) may act irresponsibly for running objects such as xlsgen’s. To ensure that the running xlsgen instance does not get disconnected or garbage collected before you’re done with it, you may want to declare the xlsgen main engine class as a class member instead of a local object. More best practices are described here.