我正在使用 MonoDevelop 3.1.1 和 Mono 运行时 3.0.12 我正在尝试在该平台上使用 Google.Apis 示例之一(例如Tasks.ETagCollision),但没有成功。我修复了所有 NuGet 引用,以便示例运行,但是当我尝试使用示例代码创建对服务器的请求时,我收到以下错误:
程序集/Library/Frameworks/Mono.framework/Versions/3.0.12/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll 中缺少方法 System.Net.HttpWebRequest::EndGetRequestStream(IAsyncResult,TransportContext&),引用在程序集中 /Users/peleyal/code.google.com/google-api-dotnet-client/samples/Tasks.CreateTasks/bin/Debug/System.Net.Http.dll
发生错误:找不到方法:'System.Net.HttpWebRequest.EndGetRequestStream'。
按任意键显示堆栈跟踪
System.MissingMethodException:找不到方法:'System.Net.HttpWebRequest.EndGetRequestStream'。在 System.Net.WebAsyncResult.CB(未使用 System.Object)[0x00000] 中:0
我检查并发现 System.dll 不包含该重载方法(它仅包含获取 IAsyncResult 的 EndGetRequestStream,但不包含额外的 TransportContext 参数)。能够在 Mono 上运行该示例会很棒。谢谢