I have experienced problems with the XmlSerializer in my application. Instantiating it causes a 10 minute timeout because the csc process seems to be deadlocked. The error is new since .NET 2.0.
The problem only occurs in a slave process, not in any of the main processes which are started directly as services or from the shell. So what special about the slave process? It's a .NET console application started fom a .NET service with Process.Start(), ShellExecute = false and RedirectStandardInput = true. The slave process reads commands from the master process in a background thread with Console.ReadLine(). In another background thread an XmlSerializer is instantiated and it fails. The error seems to be certain on machines with only one CPU and no hyper threading.
We have found a very curious workaround. The error does not occur If we omit reading from standard input in the slave or if we start the slave process with RedirectStandardInput = false! How can that influence csc.exe?
Any suggestions to the cause of the problem?
- It occurred after we migrated to .NET 2.0.
- It's certain on some machines and random on others.
- The error occurs before any commands have been send from the master process.
- The error does not occur if we omit Console.ReadLine().
- The error does not occur if we start with RedirectSta
View Complete Post