-
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 6 Preview 2 #5889
Comments
.NET Libraries: System.Text.Json - ReferenceHandler.IgnoreCyclesAdded a new Example: class Node
{
public string Description { get; set; }
public object Next { get; set; }
}
void Test()
{
var node = new Node { Description = "Node 1" };
node.Next = node;
var opts = new JsonSerializerOptions { ReferenceHandler = ReferenceHandler.IgnoreCycles };
string json = JsonSerializer.Serialize(node, opts);
Console.WriteLine(json); // Prints {"Description":"Node 1","Next":null}
} |
.NET Libraries: PriorityQueueWe have added a Sample code: // creates a priority queue of strings with integer priority
var pq = new PriorityQueue<string, int>();
// enqueue elements with associate priorities
pq.Enqueue("A", 3);
pq.Enqueue("B", 1);
pq.Enqueue("C", 2);
pq.Enqueue("D", 3);
pq.Dequeue(); // returns "B"
pq.Dequeue(); // returns "C"
pq.Dequeue(); // either "A" or "D", stability is not guaranteed. |
ASP.NET Core: SignalR - Nullable annotationsWe added nullable annotations to the SignalR client packages, and modified some of the annotations on SignalR server. Please try it out and see if the annotations make sense or not. You will need to put |
All Framework Assemblies Precompiled by Crossgen2As mentioned in the Preview1 update,
|
.NET Libraries: Numerics - Better parsing of standard numeric formats
We've improved the parser for the standard numeric types. Specifically, ExamplesOld (wrong) behavior
P2 (correct) behavior
|
.NET Multi-platform App UI[link to the tracking issue or epic item for the work] We have added .NET MAUI and single project developer experiences for Android, iOS, and Mac Catalyst. This release includes: Mac Catalyst SDK and target framework moniker (`net6) for compiling .NET MAUI apps for macOS desktop<TargetFrameworks>net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">$(TargetFrameworks);net6.0-maccatalyst</TargetFrameworks> A single, multi-targeted application projectShared fonts, images, and app iconsFonts and images can be placed in one location in your solution and .NET MAUI will enable them to natively work on all platforms you target. These are tracked in your *.csproj as <ItemGroup>
<SharedImage Include="appicon.svg" ForegroundFile="appiconfg.svg" IsAppIcon="true" />
<SharedFont Include="Resources\Fonts\ionicons.ttf" />
</ItemGroup> Both accept wildcards to include all files within a location. <ItemGroup>
<SharedImage Include="appicon.svg" ForegroundFile="appiconfg.svg" IsAppIcon="true" />
<SharedImage Include="Resources\Images\*" />
<SharedFont Include="Resources\Fonts\*" />
</ItemGroup> MauiApp with Host Builder for bootstrapping your appWe have extensions for configuring services, fonts, and compatibility renderers for migrating Xamarin.Forms projects. public class Application : MauiApp
{
public override IAppHostBuilder CreateBuilder() =>
base.CreateBuilder()
.RegisterCompatibilityRenderers()
.ConfigureServices((ctx, services) =>
{
services.AddTransient<MainPage>();
services.AddTransient<IWindow, MainWindow>();
})
.ConfigureFonts((hostingContext, fonts) =>
{
fonts.AddFont("ionicons.ttf", "IonIcons");
});
public override IWindow CreateWindow(IActivationState state)
{
Microsoft.Maui.Controls.Compatibility.Forms.Init(state);
return Services.GetService<IWindow>();
}
} New Control HandlersWe have introduced the first controls and properties that implement a new handler approach. These include partial implementations of Button, Label, and Entry, Slider, and Switch. Updates to Mobile SDKsAndroid:
iOS:
|
.NET 6 Preview 2 was released: https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-2/ |
What's new in .NET Preview 2
This issue is for teams to highlight work for the community that will release .NET 6 Preview 2.
To add content, use a new conversation entry. The entry should include the team name and feature title as the first line as shown in the template below.
Preview 1: #5853
Preview 2: #5889
Preview 3: #5890
The text was updated successfully, but these errors were encountered: