|
9 | 9 | using System.Net;
|
10 | 10 | using System.Net.Http;
|
11 | 11 | using System.Runtime.InteropServices;
|
| 12 | +using System.Text.Json; |
12 | 13 | using System.Threading.Tasks;
|
13 | 14 | using Microsoft.AspNetCore.Http;
|
14 |
| -using Newtonsoft.Json; |
15 | 15 | using WsProxy;
|
16 | 16 |
|
17 | 17 | namespace Microsoft.AspNetCore.Builder
|
@@ -97,12 +97,12 @@ private static void UseVisualStudioDebuggerConnectionRequestHandlers(this IAppli
|
97 | 97 | });
|
98 | 98 |
|
99 | 99 | context.Response.ContentType = "application/json";
|
100 |
| - await context.Response.WriteAsync(JsonConvert.SerializeObject(proxiedTabInfos)); |
| 100 | + await context.Response.WriteAsync(JsonSerializer.Serialize(proxiedTabInfos)); |
101 | 101 | }
|
102 | 102 | else if (requestPath.Equals("/json/version", StringComparison.OrdinalIgnoreCase))
|
103 | 103 | {
|
104 | 104 | context.Response.ContentType = "application/json";
|
105 |
| - await context.Response.WriteAsync(JsonConvert.SerializeObject(new Dictionary<string, string> |
| 105 | + await context.Response.WriteAsync(JsonSerializer.Serialize(new Dictionary<string, string> |
106 | 106 | {
|
107 | 107 | { "Browser", "Chrome/71.0.3578.98" },
|
108 | 108 | { "Protocol-Version", "1.3" },
|
@@ -267,7 +267,7 @@ private static async Task<IEnumerable<BrowserTab>> GetOpenedBrowserTabs(string d
|
267 | 267 | {
|
268 | 268 | using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
|
269 | 269 | var jsonResponse = await httpClient.GetStringAsync($"{debuggerHost}/json");
|
270 |
| - return JsonConvert.DeserializeObject<BrowserTab[]>(jsonResponse); |
| 270 | + return JsonSerializer.Deserialize<BrowserTab[]>(jsonResponse); |
271 | 271 | }
|
272 | 272 |
|
273 | 273 | class BrowserTab
|
|
0 commit comments