title: Using .NET GZipStream Class with Mono
body: <p>I'm trying to build an example from <a href="http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx" rel="nofollow">GZipStream Class</a>. With the command <code>gmcs gzip.cs</code>, I got error messages. gzip.cs is the same source from the msdn.</p>
  
  <p>It seems that I need to add reference when compiling. What's missing?</p>
  
  <pre><code>gzip.cs(57,32): error CS1061: Type `System.IO.FileStream' does not contain a definition for `CopyTo' and no extension method `CopyTo' of type `System.IO.FileStream' could be found (are you missing a using directive or an assembly reference?)
  /Library/Frameworks/Mono.framework/Versions/2.10.1/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)
  gzip.cs(86,40): error CS1061: Type `System.IO.Compression.GZipStream' does not contain a definition for `CopyTo' and no extension method `CopyTo' of type `System.IO.Compression.GZipStream' could be found (are you missing a using directive or an assembly reference?)
  /Library/Frameworks/Mono.framework/Versions/2.10.1/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll (Location of the symbol related to previous error)
  Compilation failed: 2 error(s), 0 warnings
  </code></pre>
  
  <h2>SOLVED</h2>
  
  <p>I should use 'dmcs', not 'gmcs' in order to use .NET 4 functions.</p>