Home DEVELOPER .NET 10.0 Preview 2 is woven with a hot needle

.NET 10.0 Preview 2 is woven with a hot needle

0


.NET 10.0 preview is for 2 downloads .NET on website Ready. A visual studio version that brings this release has not been published yet. .NET-10.0 To compile the preview 2 applications, a published version is used on March 11, 2025. Visual Studio 2022 Edition 17.14 preview 2,




Dr. Holgar Schwichtenberg is the main technology specialist in the Maximago software development. Along with the team of experts on www.it-visions.de, he also provides advice and training in the fields of Microsoft, Java and web techniques. He lectures at expert conferences and is the author of several expert books.


.NET 10.0 Establishment of Preview 2 SDK (Image 1)

.NET 10.0 Establishment of Preview 2 SDK (Image 1)

(Image: Screenshot (Holgar Shavichenburg))

.NET-SDK in command line tool dotnet Microsoft has standardized the parameter order. So far there are many orders including a noun, followed by an action or adjective (e.g. dotnet new list, dotnet workload install And dotnet nuget addBut there were some orders in which one action was standing, for example dotnet add reference And dotnet remove packageMicrosoft has now standardized it for the following new orders:

  • dotnet package add
  • dotnet package list
  • dotnet package remove
  • dotnet reference add
  • dotnet reference list
  • dotnet reference remove

The old commands are still available, so that no braking change is made here.

.NET 10.0 In preview 1 Microsoft introduced two new LINQ operators: LeftJoin() And RightJoin()In the entity framework core 10 preview 1, however, the object can only be relatively mapper LeftJoin() Translate to SQL. It is also possible in preview 2 RightJoin()It should be emphasized that right joins were already possible with the entity framework core. The new operator only reduces the syntax.

.NET 10.0 as per many innovations in Basic Class Library in preview 1 Issue notes to preview 2 Only give an innovation this time: in class X509Certificate2 There should be a new method ExportPkcs12() It is present that developers should give more control over encryption and digest algorithms. Previous method Export() Using old algorithms such as 3des and sha-1. New method ExportPkcs12() AES and SHA -2-256 should also be offered.

In release notes However, if an example is missing and the compiler can be in the classroom neither in the test. X509Certificate2 Still base class X509Certificate Method ExportPkcs12() Find. Linked Release on github Stands on the situation “to close”that I .NET 10.0 in Changel disease for preview 2 Apart from this, there is no entry ExportPkcs12() Can be found, the release notes are probably in a hurry at this point and the new method only comes in the later preview version.

There are partial classes since C# 2.0 and partial methods since C# 3.0. Last year C# 13.0 had partial properties and index. Now in C# 14.0, developers are considered partial C#Classes may also apply to constructors and events (see 1). So it stands .NET 10.0 In preview 2 in notes released in C#The compiler wants Examples of documentation But not yet translated and reports errors in both visual studio and command line command dotnet build (See Figure 2 and 3), even if you preview Writes in the project file. According to github repository The feature in visual studio comes only with version 17.14 preview 3.

partial class C
{
    partial C(int x, string y);
    partial event Action MyEvent;
}

partial class C
{
    partial C(int x, string y) { }
    partial event Action MyEvent
    {
        add { }
        remove { }
    }
}

Listing 1: Partial Builder and Partial Phenomenon. (Source: Microsoft,

.NET 10.0 Using compilation errors in visual studios in attempting partial builders and partial events in preview 2 (Fig. 2)

(Image: Screenshot (Holgar Shavichenburg))



When using compilation errors on the command line.

(Image: Screenshot (Holgar Shavichenburg))

In project template “Blazer web app” Since preview 2 you can find a new razor component in the _Layout folder called Reconnectmodal.razor. This component is represented by the modal window that shows the Blazor server when the web browser and the web server have been demolished and an attempt is made. This presentation is not yet optimal. Now developers can affect texts and presentation in three cases:

  • Restoration is tried
  • Restoration has failed and tries again
  • Restoration has finally failed

 

    

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

Listing 2: Reconnectmodal.razor's standard material Reconnectmodal.razor also includes a CSS file reconectmodal.razor.css and a JavaScript file Reconnectmodal.Rzor.JS. These files are also optimized. Reconnectmodal.razor has been integrated through mainlayout.razor And can also be completely replaced. Method NavigateTo() In class NavigationManager Now users are not attributed to the onset of the page if only the URL parameters are connected to the side:
nav.NavigateTo(nav.GetUriWithQueryParameter("count", currentCount));
Return will continue at the beginning of the side true For forceLoad instead of:
nav.NavigateTo(nav.GetUriWithQueryParameter("count", currentCount), forceLoad: true);
Or changes in part of relative path:
nav.NavigateTo("/counter/" + currentCount);
Under control Is there a new method now CloseColumnOptionsAsync()Developers can call so that the filter criteria stops penetration when the filter is activated (see List 3 and Figure 4).

  p.FlightNo)" Title="FlugNr" Sortable="true" />
  p.Departure)" Title="Abflugort" Sortable="true">
 
  
    flightGrid.CloseColumnOptionsAsync())" />
  
 
 
  p.Destination)" Title="Zielort" Sortable="true" />
  p.FlightDate)" Title="Datum" Format="dd.MM.yyyy" Sortable="true" />
Listing 3: Using Closecolumnoptionasync () in control

The call closecolumnoptionasync () ensures that the open filter input automatically closes when the user presses the input key (Image 4).

(Image: Screenshot (Holgar Shavichenburg))

NUGET package Microsoft.aspnetcore.openapi Openapi Matadata for Asp.Net Core Webapi can now also get information from XML comments that are stored in classrooms or methods. Developers can activate this integration with entry into the project file:


  true

XML comments are adopted like the Openapi document, Not in release notes And unfortunately it could not be tested, because .NET 10.0 preview 2 SDK installation only distributes all Webapi projects initially. This problem also affects projects that are made with the latest project template and have appeared on both the test computers used.

.NET maui 10.0 in preview 2, developers can now define with a simplified syntax shade:


Number is in property Shadow For offset X, offset y, radius, color and ambiguity. Earlier, you had to use your own tag here:


  

On voice output with interface TextToSpeech Can you get a speed now Rate prompt:

IEnumerable locales = await TextToSpeech.Default.GetLocalesAsync();
    SpeechOptions options = new SpeechOptions()
    {
        Rate = 2.0f, // 0.1 - 2.0
        Pitch = 1.5f,   // 0.0 - 2.0
        Volume = 0.75f, // 0.0 - 1.0
        Locale = locales.FirstOrDefault()
    };
    await TextToSpeech.Default.SpeakAsync("Hallo aus .NET 10.0!", options);

Developers can use control elements Now next OnColor Too OffColor to install:

But The color of the symbol can be controlled:


Breaking with changes So far, only one entry has been added to preview 2: .NET SDK now uses the mode offered in .NET 9.0 in the workload. "Workload set" Instead of previous standardMicrosoft "Loosely revealed" Call.

Three declared new features that do not compile (partial builder, partial events and methods ExportPkcs12()) Along with an entire project type (webapis) that no longer works on runtime, preview 2 seems to be woven with 2 very hot needles. At this point, of course, it does not allow any conclusion about the finished product, which is going to be displayed in November 2025. Such insufficiency has always been in previous preview versions. By the date of release, five more preview versions are to be released from April to August 2025 and a release candidate version in September and October.


(May)

The European Union loads against Google and Apple to violate the law of digital markets

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Exit mobile version