Something I have just picked up in my winforms app
My app does an http call to a web Api service as follows
HttpClient _client = new HttpClient();
_client.Timeout = new TimeSpan(0, 3, 0);
_client.BaseAddress = new Uri("http://Myserver/MyApp");
_client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = _client.PostAsJsonAsync("api/Addin", newObject).Result;
Nothing fancy, but as soon as you install Newtonsoft.Json (V6.0.3) via nuget
suddenly I get a stackOverflow error on the HttpResponseMessage line of code. remove Newtonsoft, and problem is solved.
The problem is I was to use the library to serialize/deserialize data elsewhere in my form
My workaround was to use a different library, I am just using System.Runtime.Serialization.Json; but this is still really weird, no?
I should also add that this is dotnet v4.0 (not 4.5), and my app is a VSTO COM object running in MsWord as an Add On
I suspect a bug maybe in Newtonsoft