File tree Expand file tree Collapse file tree
src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.TestUtilities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ namespace Microsoft.Data.SqlClient.TestUtilities
1212{
1313 public class Config
1414 {
15+ private static readonly JsonSerializerOptions JsonSerializerOptions = new ( )
16+ {
17+ AllowTrailingCommas = true ,
18+ ReadCommentHandling = JsonCommentHandling . Skip ,
19+ } ;
20+
1521 public string ? TCPConnectionString = null ;
1622 public string ? NPConnectionString = null ;
1723 public string ? TCPConnectionStringHGSVBS = null ;
@@ -86,7 +92,7 @@ public static void UpdateConfig(Config updatedConfig, string configPath = @"conf
8692 try
8793 {
8894 using StreamReader sr = new StreamReader ( configPath ) ;
89- return JsonSerializer . Deserialize < Config > ( sr . ReadToEnd ( ) ) ??
95+ return JsonSerializer . Deserialize < Config > ( sr . ReadToEnd ( ) , JsonSerializerOptions ) ??
9096 throw new InvalidOperationException ( $ "Failed to deserialize config from '{ configPath } '") ;
9197 }
9298 catch ( FileNotFoundException )
You can’t perform that action at this time.
0 commit comments