使用Monodroid PCL后出现PostFileWithRequest错误

时间:2014-03-31 10:52:36

标签: servicestack

我在使用Monodroid PCL库时遇到问题。所有电话都在工作,除了这一个:

client.PostFileWithRequest<DtoResponse>("createimage", ms, fileName, new Dto{ Id = id});

错误如下:

Object reference not set to an instance of an object at ServiceStack.Pcl.StringEqualityComparer.GetHashCode (System.String obj) [0x00000] in <filename unknown>:0
at System.Collections.Generic.Dictionary`2[System.String,System.Object].get_Item (System.String key) [0x00000] in <filename unknown>:0
at ServiceStack.Pcl.NameObjectCollectionBase.FindFirstMatchedItem (System.String name) [0x00000] in <filename unknown>:0
at ServiceStack.Pcl.NameObjectCollectionBase.BaseGet (System.String name) [0x00000] in <filename unknown>:0
at ServiceStack.Pcl.NameValueCollection.Add (System.String name, System.String value) [0x00000] in <filename unknown>:0
at ServiceStack.Pcl.HttpUtility.ParseQueryString (System.String query, System.Text.Encoding encoding, ServiceStack.Pcl.NameValueCollection result) [0x00000] in <filename unknown>:0
at ServiceStack.Pcl.HttpUtility.ParseQueryString (System.String query, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
at ServiceStack.Pcl.HttpUtility.ParseQueryString (System.String query) [0x00000] in <filename unknown>:0
at ServiceStack.AndroidPclExportClient.ParseQueryString (System.String query) [0x00000] in <filename unknown>:0 
at ServiceStack.ServiceClientBase+<>c__DisplayClass1b`1[Lodestone.Pcl.Infrastucture.Responses.ChildImage.ChildImageResponse].<PostFileWithRequest>b__18 () [0x00000] in <filename unknown>:0
at ServiceStack.ServiceClientBase.PostFileWithRequest[ChildImageResponse] (System.String relativeOrAbsoluteUrl, System.IO.Stream fileToUpload, System.String fileName, System.Object request, System.String fieldName) [0x00000] in <filename unknown>:0 "

在此之前我们没有遇到此问题。我们使用的是3.9.71 monodroid编译的dll。它们不是PCL。这只是用v4 PCL版本说的。有没有人以前遇到过这个问题,你是怎么解决的?

1 个答案:

答案 0 :(得分:0)

已将fix for this issue部署到MyGet:

https://github.com/ServiceStack/ServiceStack/wiki/MyGet

在NuGet的下一个 v4.0.16 + 版本中提供。