You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
## Team Name: Feature title
[link to the tracking issue or epic item for the work]
Tell the story of the feature and anything the community should pay particular attention
to be successful using the feature.
Added a new ReferenceHandler.IgnoreCycles option capable of ignoring cycles on serialization in a similar fashion to Newtonsoft's ReferenceLoopHandling.Ignore. Notice that this new feature replaces reference loops with JSON token null instead of ignoring the offending object/property+object.
Example:
classNode{publicstringDescription{get;set;}publicobjectNext{get;set;}}voidTest(){varnode=newNode{Description="Node 1"};node.Next=node;varopts=newJsonSerializerOptions{ReferenceHandler=ReferenceHandler.IgnoreCycles};stringjson=JsonSerializer.Serialize(node,opts);Console.WriteLine(json);// Prints {"Description":"Node 1","Next":null}}
Reacted by Issung, Abdussamet Koçak, Joel Mueller, cedwards-telis, Erik Johnson, InquestApp-Admin and Eric Mutta
We have added a PriorityQueue<TElement, TPriority> collection to the System.Collections.Generic namespace. The type is similar to Queue<T> but associates each enqueued element with a priority value. On dequeue the PriorityQueue returns the element with the smallest priority. It is implemented using an array-backed min-heap.
Sample code:
// creates a priority queue of strings with integer priorityvarpq=newPriorityQueue<string,int>();// enqueue elements with associate prioritiespq.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.
Reacted by jalaz, prime167, Leonardo Costa, Garry Newman, Fortune Ochi, OmariO, zun010, Sergey Davydov, i3ym, Mathias Roikjær and 2 more
Reacted by Chicken Sandwich, Ahmed Abuelnour, prime167, Fortune Ochi, zun010, Euan Torano, openbullet, Evgeny Morozov and Issung
Reacted by Marcin Chilicki, Ahmed Abuelnour, prime167, Fortune Ochi, zun010 and Eric Mutta
We 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 <Nullable>enable</Nullable> in your csproj in order to use the nullable annotations.
As mentioned in the Preview1 update, System.Private.CoreLib was being compiled using the new Crossgen2 toolset. As part of extending that functionality all framework assemblies are now compiled using Crossgen2. There shouldn't be any noticeable performance differences. There are some size optimizations so size on disk for NetCoreApp should be slightly smaller
We've improved the parser for the standard numeric types. Specifically, .ToString and .TryFormat will behave better when precision > 99 is specified. Also, the parser now better supports trailing zeros in the Parse method.
Examples
Old (wrong) behavior
32.ToString("C100") -> C132
Here, we had an artificial limitation in the formatting code to only handle a precision of <= 99. For precision >= 100, we instead interpreted the input as a custom format.
32.ToString("H99") -> throw a FormatException
This is correct behavior, but is called here to contrast with the next example.
32.ToString("H100") -> H132
Here, H is an invalid format specifier. So, we should've thrown a FormatException. Instead, our incorrect behavior of interpreting precision >= 100 as custom formats meant we returned wrong values.
double.Parse("9007199254740997.0") -> 9007199254740998
Here, 9007199254740997.0 is not exactly representable in the IEEE 754 format. With our current rounding scheme, the correct return value should have been 9007199254740996. However, the last .0 portion of the input was forcing the parser to incorrectly round the result and return 9007199254740998.
P2 (correct) behavior
32.ToString("C100") -> $32.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 32.ToString("H99") -> throw a FormatException 32.ToString("H100") -> throw a FormatException double.Parse("9007199254740997.0") -> 9007199254740996.
Fonts 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 SharedImage and SharedFont.
MauiApp with Host Builder for bootstrapping your app
We have extensions for configuring services, fonts, and compatibility renderers for migrating Xamarin.Forms projects. IWindow has been introduced for future multi-window support coming in a future release.
We 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.
macOS:
iOS:
Android:
Updates to Mobile SDKs
Android:
Android X libraries are now available for .NET 6 and the default dependency for Android apps
iOS:
Windows developers can use the Remote iOS Simulator
VS Mac on Windows can connect to the remote Mac build host
AOT enables build and deploy to physical iOS hardware
Reacted by Angelo Breuer, Javier Suárez, John Tur, dczuo, Glenn Hevey, James Montemagno, Hunter Phipps, Sakura Neko, kzaabox, Sergey Davydov and 7 more
Activity
jozkee commentedon Feb 18, 2021
.NET Libraries: System.Text.Json - ReferenceHandler.IgnoreCycles
dotnet/runtime#40099
Added a new
ReferenceHandler.IgnoreCyclesoption capable of ignoring cycles on serialization in a similar fashion to Newtonsoft'sReferenceLoopHandling.Ignore. Notice that this new feature replaces reference loops with JSON tokennullinstead of ignoring the offending object/property+object.Example:
JulieLeeMSFT commentedon Feb 24, 2021
CodeGen
Dynamic PGO dotnet/runtime#43618
(JIT: refactor instrumentation code runtime#47509, JIT: run instrumentation phase just after importing runtime#47476, JIT: split up some parts of flowgraph.cpp runtime#47072, JIT: let instrumentor decide which blocks to process runtime#47597, JIT: fix issues with profile incorporation phase runtime#47723, JIT: fix interaction of PGO and jitstress runtime#47876, Spanning tree instrumentation runtime#47959)
Advanced Arm64 support dotnet/runtime#43629
smulh/umulh) [Arm64] Implement MultiplyHigh runtime#47362Stabilize performance measurements dotnet/runtime#43227
eiriktsarpalis commentedon Feb 24, 2021
.NET Libraries: PriorityQueue
dotnet/runtime#43957
We have added a
PriorityQueue<TElement, TPriority>collection to theSystem.Collections.Genericnamespace. The type is similar toQueue<T>but associates each enqueued element with a priority value. On dequeue the PriorityQueue returns the element with the smallest priority. It is implemented using an array-backed min-heap.Sample code:
BrennanConroy commentedon Feb 25, 2021
ASP.NET Core: SignalR - Nullable annotations
dotnet/aspnetcore#29219
We 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
<Nullable>enable</Nullable>in your csproj in order to use the nullable annotations.mangod9 commentedon Feb 26, 2021
All Framework Assemblies Precompiled by Crossgen2
As mentioned in the Preview1 update,
System.Private.CoreLibwas being compiled using the new Crossgen2 toolset. As part of extending that functionality all framework assemblies are now compiled using Crossgen2. There shouldn't be any noticeable performance differences. There are some size optimizations so size on disk forNetCoreAppshould be slightly smallerpgovind commentedon Mar 3, 2021
.NET Libraries: Numerics - Better parsing of standard numeric formats
We've improved the parser for the standard numeric types. Specifically,
.ToStringand.TryFormatwill behave better when precision > 99 is specified. Also, the parser now better supports trailing zeros in theParsemethod.Examples
Old (wrong) behavior
32.ToString("C100")->C132Here, we had an artificial limitation in the formatting code to only handle a precision of <= 99. For precision >= 100, we instead interpreted the input as a custom format.
32.ToString("H99")-> throw aFormatExceptionThis is correct behavior, but is called here to contrast with the next example.
32.ToString("H100")->H132Here,
His an invalid format specifier. So, we should've thrown aFormatException. Instead, our incorrect behavior of interpreting precision >= 100 as custom formats meant we returned wrong values.double.Parse("9007199254740997.0")->9007199254740998Here,
9007199254740997.0is not exactly representable in the IEEE 754 format. With our current rounding scheme, the correct return value should have been9007199254740996. However, the last.0portion of the input was forcing the parser to incorrectly round the result and return9007199254740998.P2 (correct) behavior
32.ToString("C100")->$32.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032.ToString("H99")-> throw a FormatException32.ToString("H100")-> throw a FormatExceptiondouble.Parse("9007199254740997.0")->9007199254740996.davidortinau commentedon Mar 8, 2021
.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
A single, multi-targeted application project
Shared fonts, images, and app icons
Fonts 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
SharedImageandSharedFont.Both accept wildcards to include all files within a location.
MauiApp with Host Builder for bootstrapping your app
We have extensions for configuring services, fonts, and compatibility renderers for migrating Xamarin.Forms projects.
IWindowhas been introduced for future multi-window support coming in a future release.New Control Handlers
We 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.
macOS:

iOS:

Android:

Updates to Mobile SDKs
Android:
iOS:
richlander commentedon Mar 15, 2021
.NET 6 Preview 2 was released: https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-2/
[-]What's new in .NET 6 Preview 2 [WIP][/-][+]What's new in .NET 6 Preview 2[/+]