@@ -25,9 +25,10 @@ internal class HttpNodeInstance : OutOfProcessNodeInstance
25
25
private static readonly Regex PortMessageRegex =
26
26
new Regex ( @"^\[Microsoft.AspNetCore.NodeServices.HttpNodeHost:Listening on port (\d+)\]$" ) ;
27
27
28
- private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings
28
+ private static readonly JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings
29
29
{
30
- ContractResolver = new CamelCasePropertyNamesContractResolver ( )
30
+ ContractResolver = new CamelCasePropertyNamesContractResolver ( ) ,
31
+ TypeNameHandling = TypeNameHandling . None
31
32
} ;
32
33
33
34
private readonly HttpClient _client ;
@@ -58,7 +59,7 @@ private static string MakeCommandLineOptions(int port)
58
59
59
60
protected override async Task < T > InvokeExportAsync < T > ( NodeInvocationInfo invocationInfo )
60
61
{
61
- var payloadJson = JsonConvert . SerializeObject ( invocationInfo , JsonSerializerSettings ) ;
62
+ var payloadJson = JsonConvert . SerializeObject ( invocationInfo , jsonSerializerSettings ) ;
62
63
var payload = new StringContent ( payloadJson , Encoding . UTF8 , "application/json" ) ;
63
64
var response = await _client . PostAsync ( "http://localhost:" + _portNumber , payload ) ;
64
65
@@ -85,7 +86,7 @@ protected override async Task<T> InvokeExportAsync<T>(NodeInvocationInfo invocat
85
86
86
87
case "application/json" :
87
88
var responseJson = await response . Content . ReadAsStringAsync ( ) ;
88
- return JsonConvert . DeserializeObject < T > ( responseJson ) ;
89
+ return JsonConvert . DeserializeObject < T > ( responseJson , jsonSerializerSettings ) ;
89
90
90
91
case "application/octet-stream" :
91
92
// Streamed responses have to be received as System.IO.Stream instances
0 commit comments