-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NET 6.0 Support #1839
NET 6.0 Support #1839
Changes from all commits
f6a3102
68e45bb
5392518
dc43f3b
25daced
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ public async Task ShouldReturnCorrectPostdataBufferForUtf8Body() | |
|
||
await Task.WhenAll(task, actualTask); | ||
|
||
string expectedJsonValue = JsonSerializer.Serialize(value, new() | ||
string expectedJsonValue = JsonSerializer.Serialize(value, new JsonSerializerOptions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the |
||
{ | ||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, | ||
WriteIndented = true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ private static IReadOnlyList<TraceEventEntry> ParseTrace(string path) | |
var line = reader.ReadLine(); | ||
if (line == null) break; | ||
results.Add(JsonSerializer.Deserialize<TraceEventEntry>(line, | ||
new() | ||
new JsonSerializerOptions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the new() syntax fails because of a new overload to Serialize with 2 arguments. |
||
{ | ||
PropertyNameCaseInsensitive = true, | ||
})); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ internal static JsonSerializerOptions GetNewDefaultSerializerOptions() | |
=> new() | ||
{ | ||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase, | ||
IgnoreNullValues = true, | ||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IgnoreNullValues is deprecated and now Warns (Error). |
||
Converters = | ||
{ | ||
new JsonStringEnumMemberConverter(JsonNamingPolicy.CamelCase), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,7 +136,9 @@ internal async Task<T> SendMessageToServerAsync<T>( | |
object obj = propertyDescriptor.GetValue(args); | ||
if (obj != null) | ||
{ | ||
#pragma warning disable CA1845 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CA1845 is not in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are probably new built-in default rules from the SDK for the .NET 6 analysis level. |
||
string name = propertyDescriptor.Name.Substring(0, 1).ToLower() + propertyDescriptor.Name.Substring(1); | ||
#pragma warning restore CA1845 | ||
sanitizedArgs.Add(name, obj); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ public async Task ConnectAsync() | |
|
||
private async Task DispatchIncomingMessagesAsync() | ||
{ | ||
#pragma warning disable VSTHRD103 | ||
#pragma warning disable VSTHRD103, CA1849 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CA1849 is not in the |
||
var buffer = WebSocket.CreateClientBuffer(DefaultBufferSize, DefaultBufferSize); | ||
var memoryStream = new MemoryStream(); | ||
string closeReason = string.Empty; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IgnoreNullValues is deprecated and now Warns (Error).