我正在尝试使用GZipStream类中的示例代码。在执行命令gmcs gzip.cs
时,我收到了错误信息。gzip.cs是来自msdn的相同源代码。
看起来编译时需要添加引用。缺少什么?
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
问题已解决
我应该使用 "dmcs" 而不是 "gmcs" 以便使用 .NET 4 功能。