I am having alot of issues with remote debugging iOS from Visual Studio when I make calls to Json.net. To be clear, the operations themselves work just fine, but they cause the debugger to disconnect at application startup which is making for a real headache. Here is a code snippet example:
This works fine , but causes the debugger to end the session when the app launches:
var resp = response.Result.Content.ReadAsStringAsync().Result; var x = JsonConvert.DeserializeObject(resp);
Same with something more explicit:
var resp = response.Result.Content.ReadAsStringAsync().Result; Dictionary<string, object> values = JsonConvert.DeserializeObject<Dictionary<string, object>>(resp);
Removing the call to JsonConvert , means that the debugger does not crash:
var resp = response.Result.Content.ReadAsStringAsync().Result; // var x = JsonConvert.DeserializeObject(resp);
The exception thrown is:
Debugger lost connection to the running application. Likely this means the application terminated unexpectedly.
Mono.Debugger.Soft.VMDisconnectedException: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet)
at Mono.Debugger.Soft.Connection.Assembly_GetName(Int64 id)
at Mono.Debugging.Soft.SoftDebuggerSession.UpdateAssemblyFilters(AssemblyMirror asm)
at Mono.Debugging.Soft.SoftDebuggerSession.HandleAssemblyLoadEvents(AssemblyLoadEvent events)
at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
Which this seems to be telling me there is something about the assembly that mono does not like , but not sure at all how to go about remedying this.
I have Newtonsoft.Json 6.0 installed via Nuget and referenced by both projects. The fact that the code works correctly seems to indicate that the correct libraries are there.
Anyone having a similar issue and figure out how to get around it?