.NET 7 RC 1 has been released, and this is the first of two release candidates (RCs) for .NET 7 to support production.
Download .NET 7 Release Candidate 1
New in .NET 7 RC 1:
Support default use of ICU library on Windows Server 2019
Windows Server 2019 lacks ICU support. Services and applications running on Windows Server 2019 that want to use ICU need to deploy ICU and enable some configuration to use it, as described in the documentation.
In .NET 7.0 rc1, Windows Server 2019 will support ICU by default.
References: dotnet/runtime#62329, dotnet/runtime#72656 and dotnet/docs#30319.
Improve the calculation accuracy of the Add method in DateTime and DateTimeOffset
Improved the calculation precision of the DateTime and DateTimeOffset methods: AddDays, AddHours, AddMinutes, AddSeconds, AddMilliseconds, and AddMicroseconds to produce better results.
Reference: dotnet/runtime#66815 and dotnet/runtime#73198
System.Diagnostics.TraceSource can be initialized from app.config file
For easier migration from the .NET Framework, added support for initializing TraceSource and related types (including Switch and TraceListener) from application configuration files. Note that an explicit call must be made to enable this feature via System.Diagnostics.TraceConfiguration.Register().
Reference: dotnet/runtime#23937 and dotnet/runtime#73087
Support XmlSchema import/export
.NET 7 RC1 brings the return of importing and exporting XmlSchema in the DataContractSerializer space. The API is as similar as possible to the .NET Framework 4.8 API for easy porting of code from the .NET Framework.
This export functionality is built-in with the DataContractSerializer in the .NET 7.0 SDK and is available in an add-on package named System.Runtime.Serialization.Schema. (This package is not part of the 7.0 SDK because it depends on System.CodeDom and is also available as a separate package.)
References: dotnet/runtime#72243 and 4.8 Export and Import API documentation.
Detect HTTP/2 and HTTP/3 protocol errors
HTTP/2 and HTTP/3 protocol error codes are now detected when using HttpClient with the default SocketsHttpHandler. This feature is useful for advanced applications such as gRPC.
usage
When calling the HttpClient method:
using 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 a Response Stream method
using 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);
}
Reference: dotnet/runtime#70684.
See Issue #7716 for additional features in this release candidate, or check out the update blog.
#NET #RC1 #Released #ProductionAvailable #Release #Candidate #News Fast Delivery