.NET 7 has released its second release candidate

.NET 7 RC2 has been released as the latest Release Candidate (RC) for .NET 7, which has been tested with Visual Studio 17.4 Preview 3 and is supported in production environments.

Click here to download .NET 7 RC2 for Windows, macOS and Linux. To try .NET 7 in the Visual Studio family of products, we recommend building with the preview channel . If using macOS, the latest Visual Studio 2022 for Mac preview is recommended .

What's New in .NET 7 RC 2

Re-enable reflection fallback for System.Text.Json source generation

.NET 7 introduces a breaking change that removes the silent fallback for reflection-based serialization in the System.Text.Json source generator. But it seems that many users are still relying on fallback behavior. Therefore, starting with .NET 7 RC 2, users can re-enable reflection fallback globally using the AppContext compatibility switch. 

Add the following entry to your application's project file to re-enable reflective fallback for all source build contexts in your application:

<ItemGroup>
  <RuntimeHostConfigurationOption Include="System.Text.Json.Serialization.EnableSourceGenReflectionFallback" Value="true" />
</ItemGroup>

For a detailed introduction to how to use the AppContext switch, see .NET Runtime Configuration Settings .

Correctly implement common math interface ( dotnet/runtime #69775 )

Ensure that the .NET Common Math Interface using the singular recursive template pattern (CRTP) is implemented correctly in user code. It will warn if a type implementing the .NET Generic Math Interface (implementing the CRTP schema) does not populate a generic type parameter with the type itself. E.g:

public readonly struct DateOnly : IParsable<DateOnly> // correct implementation of IParsable<TSelf> interface
{ ... }
public readonly struct MyDate : IParsable<DateOnly> // Warns: "The 'IParsable<TSelf>' requires the 'TSelf' type parameter to be filled with the derived type 'MyDate' " the type parameter TSelf
{ ... }

Prevent behavior changes in built-in operators for IntPtr and UIntPtr ( dotnet/runtime #74022 )

 

.NET 7 RC 2 related links:

For additional content, check out the Microsoft Update Blog .

 

Guess you like

Origin www.oschina.net/news/213869/dotnet-7-rc-1-released