NancyFx/Nancy — pull request #773 by thefringeninja (2012-10-03 03:23:15+00:00)
Title: Race Conditions in Razor View Engine

Here's the failing test and possible solution for issue #751 (couldn't figure out how to attach code to it).

System.IndexOutOfRangeException: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.