-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
What's new in .NET 7 RC 1 #7716
Comments
FYI: There is a feature we didn't get time to document for P7 (due to vacation, resourcing, etc.) - sorry for that! -- Perhaps we can include it in RC1 blog post? Or maybe the P7 response will be turned into P7 blog post update? @leecow can you please advise? Thanks! |
@karelz we can add it to the RC1 blog post, it's not the first time that happens. If we updated the P7 post nobody would see it. 😅 |
WebSockets over HTTP/2The WebSocket Protocol over HTTP/2 is based on the RFC 8441. It uses a different approach than web sockets over HTTP/1.1 due to the multiplexing nature of the HTTP/2 connection. It allows to have streams of both protocols (WebSockets and plain HTTP/2) in one connection simultaneously and therefore use the network more efficiently. To manage the connection with several streams of one or both protocols, you have to provide a custom In case the server does not support WebSockets over HTTP/2 or does not support HTTP/2 protocol at all, you can allow downgrade to WebSockets over HTTP/1.1 by setting up the respective policy in the Usagevar handler = new SocketsHttpHandler();
ClientWebSocket ws = new();
ws.Options.HttpVersion = HttpVersion.Version20;
// to disable downgrade
ws.Options.HttpVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher;
// by default downgrade is enabled:
// ws.Options.HttpVersionPolicy = HttpVersionPolicy.RequestVersionOrLower;
ws.ConnectAsync(uri, new HttpMessageInvoker(handler), cancellationToken); References |
@ericstj @jeffhandley anything from your teams? |
Support using ICU library by default on Windows Server 2019.NET started to use the ICU library for globalization support in .NET 5.0 and up. Windows Server 2019 was lacking ICU support. Services and apps running on Windows Server 2019 which want to use ICU, needed to deploy ICU and enable some configuration to use it as described in the doc. In .NET 7.0, the ICU will be supported by default on Windows Server 2019. ReferencesSee dotnet/runtime#62329, dotnet/runtime#72656, and dotnet/docs#30319 |
Improve the calculation precision of Add methods in DateTime and DateTimeOffsetImproved the calculation precision of the References |
System.Diagnostics.TraceSource can now be initialized from the app.config filePrimarily to make it easier to migrate from .NET Framework, support was added for initializing a Note that an explicit call must be made to enable this functionality through UsageA package reference to An example C# console app named Sample of a config file: <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<source name ="MyTraceSource" switchName="MainToggle" switchType="System.Diagnostics.SourceSwitch" />
</sources>
<switches>
<add name = "MainToggle" value="Error" /> <!-- Set to Off to disable logging -->
</switches>
</system.diagnostics>
</configuration> and C# using System.Diagnostics;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
TraceConfiguration.Register(); // Required to enable reading from the config file.
// Get the configured TraceSource
TraceSource ts = new TraceSource("MyTraceSource", SourceLevels.Error);
// Add a listener
TextWriterTraceListener listener = new("TextWriterOutput.log", "myListener");
ts.Listeners.Add(listener);
// The "MainToggle" SourceSwitch in the config file is set to Error, so this will log:
ts.TraceEvent(TraceEventType.Error, 101, "Error message.");
listener.Flush();
}
}
} References |
Support XmlSchema Import/Export with DataContractSerializer.NET 7.0-RC1 brings the return of XmlSchema importing and exporting from .NET Framework 4.8 in the DataContractSerializer space. The API is as similar to the 4.8 API as possible to enable easy porting of code from .NET Framework. The export functionality is a built-in feature along with DataContractSerializer in the 7.0 SDK. The import functionality is available in an add-on package named System.Runtime.Serialization.Schema. (This package is not part of the 7.0 SDK as it depends on System.CodeDom, which is also shipped as a separate package.) ReferencesSee dotnet/runtime#72243, and the 4.8 Export and Import API docs for the Framework feature that preceded this work. |
(copying #7455 (comment) here to make sure you don't miss it) Detecting HTTP/2 and HTTP/3 protocol errorsWhen using UsageWhen calling HttpClient methodsusing var client = new HttpClient();
try
{
var response = await client.GetStringAsync("https://myservice");
}
catch (HttpRequestException ex) when (ex.InnerException is HttpProtocolException protocolException)
{
Console.WriteLine("HTTP2/3 protocol error code: " + protocolException.ErrorCode);
} When calling response stream methodsusing var client = new HttpClient();
using var response = awaitclient.GetAsync("https://myservice", HttpCompletionOption.ResponseHeadersRead);
using var responseStream = await response.Content.ReadAsStreamAsync();
using var memoryStream = new MemoryStream();
try
{
await responseStream.CopyToAsync(memoryStream);
}
catch (HttpProtocolException protocolException)
{
Console.WriteLine("HTTP2/3 protocol error code: " + protocolException.ErrorCode);
} References |
I didn't see list of above features in RC1 blog post https://devblogs.microsoft.com/dotnet/announcing-dotnet-7-rc-1/ -- did I miss it, or was it intentional? @JeremyLikness @leecow |
|
@JonDouglas the above info was missed from the RC1 post. Could we please include in RC2? Cc @leecow |
@danmoseley We missed this issue after looking for it last week. Which is also why the blog PR wasn't linked to this issue. Since it's only been a week, perhaps we can just backfill this content to RC1? (Still healthy viewership). I tagged us for the RC2 issue so we have visibility. Thanks for the heads up! |
@JonDouglas if we add it into RC1 blog post 1 week late (which is IMO fine), perhaps we can then mention the fact (of late update) in RC2 blog post and catch 1st-week set of viewers? |
@karelz Sure thing. We will also include it in the RTM blog more expanded. |
.NET 7 GA is available. Closing these pre-release issues. |
What's new in .NET 7 RC 1
This issue is for teams to highlight work for the community that will release .NET 7 RC 1
To add content, use a new conversation entry. The entry should include the team name and feature title as the first line shown in the template below.
Preview 1: #7106
Preview 2: #7107
Preview 3: #7108
Preview 4: #7378
Preview 5: #7441
Preview 6: #7454
Preview 7: #7455
RC 1: #7716
RC 2: #7717
The text was updated successfully, but these errors were encountered: