Getting Unexpected character encountered while parsing value: ?. Path '', line 0, position 0. error in BUILD server

Jan 5, 2013 at 1:07 AM

Hi

I am getting  "

Newtonsoft.Json.JsonReaderException : Unexpected character encountered while parsing value: ?. Path '', line 0, position 0.
when I use JsonConvert.DeserializeObject method .
Following is the josn string I am trying to convert to c# object 

{"$type":"EE.CC.NT.Contract.V2.GetVersionResponseType, EE.CC.NT.Contract.V2","EnvironmentProfile":"maui","Interface":{"$type":"EE.CC.NT.Contract.V2.ComponentVersionType, EE.CC.NT.Contract.V2","Name":"com.EE.NT.interface.v1","Release":null,"Version":"4.6.0.11","BuildTime":"2012-12-19 15:31:56","BuildType":"directedbuilds"},"Service":{"$type":"EE.CC.NT.Contract.V2.ComponentVersionType, EE.CC.NT.Contract.V2","Name":"com.EE.NT.service","Release":"2.2","Version":"4.6.0.22","BuildTime":"2013-01-02 10:13:39","BuildType":"directedbuilds"},"RequestId":"c0661612-c036-4fd4-8f35-3de0632dfac3","ContractVersion":"4.6.0.11"}

I am calling desrializeObject method with string and type as parametes
JsonConvert.DeserializeObject(jsonData, type);
The deserialization works in my dev mechine . But it fails on the build server .
Anybody had similar issue ? 
Jan 5, 2013 at 1:08 AM

Adding stack trace of error 

 

 Newtonsoft.Json.JsonReaderException : Unexpected character encountered while parsing value: ?. Path '', line 0, position 0.
     Stack Trace:
        at Newtonsoft.Json.JsonTextReader.ParseValue()
        at Newtonsoft.Json.JsonTextReader.ReadInternal()
        at Newtonsoft.Json.JsonTextReader.Read()
        at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
        at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
        at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
        at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
        at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
        at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type)