@@ -25,9 +25,10 @@ internal class HttpNodeInstance : OutOfProcessNodeInstance
2525 private static readonly Regex PortMessageRegex =
2626 new Regex ( @"^\[Microsoft.AspNetCore.NodeServices.HttpNodeHost:Listening on port (\d+)\]$" ) ;
2727
28- private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings
28+ private static readonly JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings
2929 {
30- ContractResolver = new CamelCasePropertyNamesContractResolver ( )
30+ ContractResolver = new CamelCasePropertyNamesContractResolver ( ) ,
31+ TypeNameHandling = TypeNameHandling . None
3132 } ;
3233
3334 private readonly HttpClient _client ;
@@ -58,7 +59,7 @@ private static string MakeCommandLineOptions(int port)
5859
5960 protected override async Task < T > InvokeExportAsync < T > ( NodeInvocationInfo invocationInfo )
6061 {
61- var payloadJson = JsonConvert . SerializeObject ( invocationInfo , JsonSerializerSettings ) ;
62+ var payloadJson = JsonConvert . SerializeObject ( invocationInfo , jsonSerializerSettings ) ;
6263 var payload = new StringContent ( payloadJson , Encoding . UTF8 , "application/json" ) ;
6364 var response = await _client . PostAsync ( "http://localhost:" + _portNumber , payload ) ;
6465
@@ -85,7 +86,7 @@ protected override async Task<T> InvokeExportAsync<T>(NodeInvocationInfo invocat
8586
8687 case "application/json" :
8788 var responseJson = await response . Content . ReadAsStringAsync ( ) ;
88- return JsonConvert . DeserializeObject < T > ( responseJson ) ;
89+ return JsonConvert . DeserializeObject < T > ( responseJson , jsonSerializerSettings ) ;
8990
9091 case "application/octet-stream" :
9192 // Streamed responses have to be received as System.IO.Stream instances
0 commit comments