この次のコードは、時々例外をスローするため、問題を理解するのが非常に難しくなります。
GetFeaturedApiRequest request = new GetFeaturedApiRequest ();
request.RequesterID = GlobalData.UserHeykuId;
request.Index = index;
request.RequesterIP = GlobalData.UserIp;
try
{
string jsonReq = JsonConvert.SerializeObject (request);
.
.
.
}catch (Exception message)
これは、すべての値が初期化されていることを 100% 確認するためのスタック トレースです。
未処理のマネージド例外: オブジェクト参照が Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.GetContractSafe (System.Object 値) [0x00000] のオブジェクトのインスタンス (System.NullReferenceException) に設定されていません: Newtonsoft.Json.Serialization.JsonSerializerInternalWriter の :0。 Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value) [0x00000] in :0 at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value) [0x00000] in :0 at Newtonsoft. Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter、System.Object 値) [0x00000] in :0 at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object 値、書式設定、Newtonsoft.Json.JsonSerializerSettings 設定) [0x00000 ] in :0 at Newtonsoft.Json.JsonConvert.SerializeObject (System.オブジェクト値) [0x00000] in :0 at HeyKu.LoadDataFromServerManager.LoadFeaturedFeedFromServer (Int32 index, HeyKu.handleEndOfLoadData handle, Boolean isFirst) [0x00000] in :0 at HeyKu.LoadDataFromServerManager.LoadInitialDataFromServer (Boolean loadProfile) [0x00000] in :0 at HeyKu.LoadDataFromServerManager.LoadInitialDataFromServer () [0x00000] in :0 HeyKu.AppDelegate.m__2 () [0x00000] in :0 System.Threading.Thread.StartInternal () [0x00000] in :0m__2 () [0x00000] in :0 で System.Threading.Thread.StartInternal () [0x00000] in :0m__2 () [0x00000] in :0 で System.Threading.Thread.StartInternal () [0x00000] in :0
ご協力ありがとうございました