NET 10.0 Preview 4: Web Development
#.NET 10.0 Preview 4: Web API and Blazor Enhancements
.NET 10.0 Preview 4 is now available for download,bringing innovations to web progress with new web APIs based on ASP.NET Core and improvements to the blazor framework. You can find it on the [.NET download page](https://dotnet.microsoft.com/en-us/download/dotnet/10.0).

In parallel, Visual Studio 2022 version 17.14 has been released in a stable version, alongside Visual studio 2022 version 17.14 Preview 7. With Microsoft’s Build conference 2025 taking place from may 19-22 in Seattle and online, a new major version could be unveiled. The last major release before Visual Studio 2022 was Visual studio 2019.

## JSON Patch for System.Text.Json and ASP.NET core-Based Web APIs
ASP.NET Core 10.0 now supports the JSON patch standard according to RFC 6902, utilizing Microsoft’s JSON serializer `System.Text.Json`. This is achieved with the help of the additional package [`Microsoft.AspNetCore.JsonPatch.systemtextjson`](https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch.systemtextjson/10.0.0-preview.4.25258.110).
Previously, JSON Patch was only available with the older library `Newtonsoft.Json`. Microsoft promises improved performance and reduced storage usage compared to `Newtonsoft.Json`, while maintaining a similar design, including the ability to update embedded objects and arrays. JSON Patch for dynamic objects is not yet available as `Newtonsoft.Json` uses reflection for this purpose. `System.Text.Json` is expected to work with the native AOT compiler.
The NuGet package `Microsoft.aspnetcore.jsonpatch` contains the class `JsonPatchDocument
“`csharp
// Original object
var person = new Person
{
FirstName = “John”,
LastName = “Doe”,
Email = “johndoe@gmail.com”,
PhoneNumbers = [new() { Number = “123-456-7890”, type = PhoneNumberType.Mobile }],
Address = new Address
{
Street = “123 Main St”,
City = “Anytown”,
State = “TX”
}
};
// Raw JSON patch document
string jsonPatch = “””
[
{ “op”: “replace”, “path”: “/FirstName”, “value”: “Jane” },
{ “op”: “remove”, “path”: “/Email”},
{ “op”: “add”, “path”: “/Address/ZipCode”, “value”: “90210” },
{ “op”: “add”, “path”: “/PhoneNumbers/-“, “value”: { “Number”: “987-654-3210”, “Type”: “Work” } }
]
“””;
// Deserialize the JSON patch document
var patchDoc = JsonSerializer.Deserialize
// Apply the JSON patch document
patchDoc!.applyto(person);
// Output updated object
Console.WriteLine(JsonSerializer.Serialize(person, serializerOptions));
“`
This code produces the following output:
“`json
output:
{
“firstName”: “Jane”,
“lastName”: “Doe”,
“address”: {
“street”: “123 Main St”,
“city”: ”Anytown”,
“state”: “TX”,
“zipCode”: “90210”
},
“phoneNumbers”: [
{
“number”: “123-456-7890”,
“type”: “Mobile”
},
{
“number”: “987-654-3210”,
“type”: “Work”
}
]
}
“`
## Rounding Out previous Innovations
Since ASP.NET Core 10.0 Preview 3, parameters have also been validated in minimal web APIs.
.NET 10.0 Preview 4: Your Questions Answered
Table of Contents
- .NET 10.0 Preview 4: Your Questions Answered
- What’s new in .NET 10.0 Preview 4?
- What are the major improvements in ASP.NET Core 10.0 Preview 4?
- What is JSON Patch and how does it work in .NET 10.0?
- How does JSON Patch in .NET 10.0 Preview 4 compare to previous implementations?
- What are the benefits of using system.Text.Json wiht JSON Patch?
- How do I use JSON Patch in my ASP.NET Core Web API?
- Can you provide a code example demonstrating how to use JSON Patch?
- What is the output of the JSON Patch example?
- Are there any limitations to using JSON Patch in this .NET 10.0 Preview?
- Beyond JSON Patch, what else is new in ASP.NET Core 10.0?
- what’s the relationship between .NET 10.0 Preview 4 and Visual Studio 2022?
- When is the next major .NET release likely to be?
- Summary of .NET 10.0 Preview 4 Enhancements
Here’s a Q&A guide to .NET 10.0 Preview 4, covering its key features and improvements:
What’s new in .NET 10.0 Preview 4?
.NET 10.0 Preview 4 introduces innovations for web growth, including enhancements to ASP.NET Core and Blazor. You can download it from the .NET download page.
What are the major improvements in ASP.NET Core 10.0 Preview 4?
A key feature is the introduction of JSON patch support for ASP.NET Core-based Web APIs. This allows for partial updates to JSON objects, which can lead to performance gains.
What is JSON Patch and how does it work in .NET 10.0?
JSON Patch, as defined by RFC 6902, provides a way to describe changes to a JSON document. In .NET 10.0, this is supported by System.Text.Json and the Microsoft.AspNetCore.JsonPatch.systemtextjson NuGet package. This allows developers to efficiently update only parts of a JSON object.
How does JSON Patch in .NET 10.0 Preview 4 compare to previous implementations?
Previously, JSON Patch was primarily available through the Newtonsoft.Json library. The new implementation in .NET 10.0 using System.Text.Json promises improved performance and efficiency in storage usage compared to Newtonsoft.Json.
What are the benefits of using system.Text.Json wiht JSON Patch?
System.Text.Json offers several advantages, including:
Improved Performance: Generally faster serialization and deserialization compared to Newtonsoft.Json.
Reduced Storage Usage: More efficient use of memory and disk space.
* Native AOT Compatibility: Expected to work well with the native AOT compiler, leading to further performance gains.
How do I use JSON Patch in my ASP.NET Core Web API?
You’ll need to use the Microsoft.AspNetCore.JsonPatch.systemtextjson NuGet package. The core class to work with is JsonPatchDocument,which has an ApplyTo(obj) method.
Can you provide a code example demonstrating how to use JSON Patch?
Here’s a code example of how to apply a JSON patch to a Person object:
csharp
// Original object
var person = new Person
{
FirstName = "John",
LastName = "Doe",
Email = "johndoe@gmail.com",
PhoneNumbers = [new() { Number = "123-456-7890", type = phonenumbertype.Mobile }],
Address = new Address
{
Street = "123 Main St",
City = "Anytown",
State = "TX"
}
};
// Raw JSON patch document
string jsonPatch = """
[
{ "op": "replace", "path": "/FirstName", "value": "jane" },
{ "op": "remove", "path": "/Email"},
{ "op": "add", "path": "/Address/ZipCode", "value": "90210" },
{ "op": "add", "path": "/PhoneNumbers/-", "value": { "Number": "987-654-3210", "Type": "Work" } }
]
""";
// Deserialize the JSON patch document
var patchDoc = JsonSerializer.Deserialize(jsonPatch);
// Apply the JSON patch document
patchDoc!.applyto(person);
// Output updated object
console.WriteLine(JsonSerializer.Serialize(person, serializerOptions));
This code demonstrates how to define a JSON patch as a string, deserialize it, and apply it to an object.
What is the output of the JSON Patch example?
The code produces the following output:
json
{
"firstName": "Jane",
"lastName": "Doe",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "TX",
"zipCode": "90210"
},
"phoneNumbers": [
{
"number": "123-456-7890",
"type": "Mobile"
},
{
"number": "987-654-3210",
"type": "Work"
}
]
}
Are there any limitations to using JSON Patch in this .NET 10.0 Preview?
Yes, currently, JSON Patch for dynamic objects is not yet available due to System.Text.Json not supporting reflection in the same way Newtonsoft.Json does.
Beyond JSON Patch, what else is new in ASP.NET Core 10.0?
ASP.NET Core 10.0 Preview 3 introduced parameter validation in minimal web APIs, building on previous innovations.
what’s the relationship between .NET 10.0 Preview 4 and Visual Studio 2022?
Visual Studio 2022 version 17.14 has been released as a stable version alongside version 17.14 Preview 7. There is a strong connection between these releases, with .NET 10.0 updates ofen coinciding with corresponding features and improvements within Visual Studio.
When is the next major .NET release likely to be?
With Microsoft’s Build conference 2025 scheduled for May 19-22 in Seattle, a new major version might be unveiled. The last major release before Visual Studio 2022 was Visual Studio 2019.
Summary of .NET 10.0 Preview 4 Enhancements
Here’s a table summarizing the key features and benefits:
“html
| Feature | Description | Benefits |
|---|---|---|
| JSON Patch Support | Implements RFC 6902 for partial updates using System.Text.Json. |
Improved performance, reduced storage usage, native AOT compatibility. |
| NuGet Package | Uses the Microsoft.AspNetCore.JsonPatch.systemtextjson` package. | Simplified integration and usage within ASP.NET Core projects. |
| Parameter Validation (Preview
|
