I'm running the following method on my development IIS server (from VS2010 IDE) on a 64-bit Windows 7 machine with 16GB of installed RAM:\[code\]public static MemoryStream copyStreamIntoMemoryStream(Stream stream){ long uiLen = stream.Length; byte[] buff = new byte[0x8000]; int nSz; MemoryStream ms = new MemoryStream(); try { while ((nSz = stream.Read(buff, 0, buff.Length)) != 0) { ms.Write(buff, 0, nSz); } } finally { Debug.WriteLine("Alloc size=" + ms.Length); } return ms;}\[/code\]and I get the \[code\]System.OutOfMemoryException\[/code\] on this line:\[code\]ms.Write(buff, 0, nSz);\[/code\]That is thrown when 268435456 bytes are allocated:\[quote\] Alloc size=268435456\[/quote\]which is 0x10000000 or 256 MB. So I'm wondering if there's some global setting that I need to set to make it work?Here's a screenshot of the configuration setting for the project: