codingadventures / LINQBridgeVs

Dumps the content of variables during debugging in Visual Studio to LINQPad
MIT License
127 stars 21 forks source link

Possible interfering with HTTP Client deserializing #64

Open EricAriensGit opened 5 years ago

EricAriensGit commented 5 years ago

After installing LINQBridge one of our project was throwing runtime errors. We debugged and found the problem in serializing/deserializing data. The error was in the BaseHTTPClient After replacing ` protected static T ReadResponse(HttpResponseMessage response) { if (response.IsSuccessStatusCode) { var task = response.Content.ReadAsAsync(); return task.Result; }

        response.EnsureSuccessStatusCodeWithContent();
        return default(T);
    }

`

with this ` protected static T ReadResponse(HttpResponseMessage response) { List m = new List(); m.Add(new JsonMediaTypeFormatter { SerializerSettings = new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All } });

        if (response.IsSuccessStatusCode)
        {
            var task = response.Content.ReadAsAsync<T>(m);

            return task.Result;
        }

        response.EnsureSuccessStatusCodeWithContent();
        return default(T);
    }

`

The problem was solved

codingadventures commented 5 years ago

Hi Eric,

Thanks for reporting this issue. The installation itself shouldn't generate issues, however I guess you bridged the entire solution, is that correct?

I would need more info to replicate this bug, could you tell me the definition of type T that is generating the runtime error? Also, what exception are you seeing?