diff options
author | nosami <jasonimison@gmail.com> | 2019-11-11 17:13:53 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-11-13 21:37:13 +0300 |
commit | c6934bfbb79295449fc27b6f529b7dd8af2a0a98 (patch) | |
tree | 7fad38be257c6b225be516f1c2dbd92bee3d80e4 | |
parent | f953306828439391203384a1f45e3be3504a7a68 (diff) |
deserialize directly from stream
-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 dcdcf06d89..0becd87caa 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; } |