diff options
author | nosami <jasonimison@gmail.com> | 2019-11-11 17:13:53 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-11-13 14:41:46 +0300 |
commit | 5f32dd4cf53ba9f3f2d70bb56e7fa69e3b21e15f (patch) | |
tree | e6eb6f467b8382b6c9ec51c31915a6f5f33296a3 /main/src/addins/MonoDevelop.AspNetCore | |
parent | e67ebfe994cd70ff65a7644ae4e41f5ed188ce60 (diff) |
deserialize directly from stream
Diffstat (limited to 'main/src/addins/MonoDevelop.AspNetCore')
-rw-r--r-- | main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs index 89930fcd62..58520c7e41 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs @@ -83,10 +83,12 @@ namespace Microsoft.WebTools.Scaffolding.Core.Config // fallback to embedded resource stream = typeof (ScaffoldingConfig).Assembly.GetManifestResourceStream ("ScaffoldingPackageVersions.json"); } - - using var streamReader = new StreamReader (stream); - var json = await streamReader.ReadToEndAsync (); - fetchedConfig = JsonConvert.DeserializeObject<ScaffoldingConfig> (json); + + var serializer = new JsonSerializer (); + + using var sr = new StreamReader (stream); + using var jsonTextReader = new JsonTextReader (sr); + return serializer.Deserialize<ScaffoldingConfig> (jsonTextReader); } return fetchedConfig; } |