Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions aspnetcore/includes/net-prereqs-vs-11-latest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* [Visual Studio](https://visualstudio.microsoft.com/downloads/) with the **ASP.NET and web development** workload.

![VS22 installer workloads](~/tutorials/min-web-api/_static/asp-net-web-dev.png)
5 changes: 5 additions & 0 deletions aspnetcore/includes/net-prereqs-vsc-11.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* [Visual Studio Code](https://code.visualstudio.com/download)
* [C# Dev Kit for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
* [!INCLUDE [](~/includes/0-latest-SDK.md)]

You can follow the Visual Studio Code instructions on macOS, Linux, or Windows. Changes may be required if you use an integrated development environment (IDE) other than Visual Studio Code.
78 changes: 78 additions & 0 deletions aspnetcore/migration/100-to-110.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Migrate from ASP.NET Core in .NET 10 to ASP.NET Core in .NET 11
author: wadepickett
description: Learn how to migrate an ASP.NET Core in .NET 10 to ASP.NET Core in .NET 11.
ms.author: wpickett
ms.date: 01/26/2026
uid: migration/100-to-110
---
# Migrate from ASP.NET Core in .NET 10 to ASP.NET Core in .NET 11

<!-- New content should be added to the includes files in the '100-to-110' folder. This will help prevent merge conflicts in this file. -->

This article explains how to update an ASP.NET Core in .NET 10 to ASP.NET Core in .NET 10.

## Prerequisites

# [Visual Studio](#tab/visual-studio)

[!INCLUDE[](~/includes/net-prereqs-vs-11-latest.md)]

# [Visual Studio Code](#tab/visual-studio-code)

[!INCLUDE[](~/includes/net-prereqs-vsc-11.0.md)]

---

## Update the .NET SDK version in `global.json`

If you rely on a [`global.json`](/dotnet/core/tools/global-json) file to target a specific .NET SDK version, update the `version` property to the .NET 11 SDK version that's installed. For example:

```diff
{
"sdk": {
- "version": "10.0.102"
+ "version": "11.0.100"
}
}
```

## Update the target framework

Update the project file's [Target Framework Moniker (TFM)](/dotnet/standard/frameworks) to `net11.0`:

```diff
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
- <TargetFramework>net10.0</TargetFramework>
+ <TargetFramework>net11.0</TargetFramework>
</PropertyGroup>

</Project>
```

## Update package references

In the project file, update each [`Microsoft.AspNetCore.*`](https://www.nuget.org/packages?q=Microsoft.AspNetCore.*), [`Microsoft.EntityFrameworkCore.*`](https://www.nuget.org/packages?q=Microsoft.EntityFrameworkCore.*), [`Microsoft.Extensions.*`](https://www.nuget.org/packages?q=Microsoft.Extensions.*), and [`System.Net.Http.Json`](https://www.nuget.org/packages/System.Net.Http.Json) package reference's `Version` attribute to 11.0.0 or later. For example:

```diff
<ItemGroup>
- <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.0" />
- <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0" />
- <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.0" />
- <PackageReference Include="System.Net.Http.Json" Version="10.0.0" />
+ <PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="11.0.0" />
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="11.0.0" />
+ <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="11.0.0" />
+ <PackageReference Include="System.Net.Http.Json" Version="11.0.0" />
</ItemGroup>
```

## Blazor

[!INCLUDE[](~/migration/100-to-110/includes/blazor.md)]

## Breaking changes

Use the articles in [Breaking changes in .NET](/dotnet/core/compatibility/breaking-changes) to find breaking changes that might apply when upgrading an app to a newer version of .NET.
54 changes: 54 additions & 0 deletions aspnetcore/migration/100-to-110/includes/blazor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
### Blazor release notes

For new feature coverage, see <xref:aspnetcore-11>.

### Adopt Inline JS event handler removed from the `NavMenu` component

*This section only applies to Blazor Web Apps.*

The inline JS event handler for the navigation bar toggler isn't present in the `NavMenu` component of the Blazor Web App project template in .NET 11 or later. Apps generated from the project template use a [collocated JS module](xref:blazor/js-interop/javascript-location#load-a-script-from-an-external-javascript-file-js-collocated-with-a-component) approach to show or hide the navigation links on the rendered page. The approach improves [Content Security Policy (CSP) compliance](xref:blazor/security/content-security-policy) because it doesn't require the CSP to include an unsafe hash for the inline JS.

Use the following instructions to adopt the new JS module approach for the navigation links toggler in an existing app.

Add a [collocated JS module](xref:blazor/js-interop/javascript-location#load-a-script-from-an-external-javascript-file-js-collocated-with-a-component) next to the app's `NavMenu` component.

`NavMenu.razor.js`:

```javascript
// Handle navigation menu toggle
const navScrollable = document.getElementById("nav-scrollable");
const navToggler = document.querySelector(".navbar-toggler");

if (navScrollable && navToggler) {
navScrollable.addEventListener("click", function() {
navToggler.click();
});
}
```

At the top of the app's `NavMenu` component (`NavMenu.razor`), add a `<script>` tag for the collocated JS module:

* If the app adopts client-side rendering (has a `.Client` project) with global interactivity (the render mode is set globally for the app by the app's `App` component), use the following tag, which indicates the path to the module in the `Layout` folder:

```razor
<script type="module" src="@Assets["Layout/NavMenu.razor.js"]"></script>
```

* Otherwise, use the following tag, which indicates the path to the module in the `Components/Layout` folder:

```razor
<script type="module" src="@Assets["Components/Layout/NavMenu.razor.js"]"></script>
```

Also in the app's `NavMenu` component, change the line that has the inline JS to toggle the navigation links:

```diff
- <div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
+ <div id="nav-scrollable" class="nav-scrollable">
```

If the app has a [Content Security Policy (CSP)](xref:blazor/security/content-security-policy#server-side-blazor-apps) with an unsafe hash for the inline JS removed by the preceding step, remove the unsafe hash:

```diff
- 'unsafe-hashes' 'sha256-qnHnQs7NjQNHHNYv/I9cW+I62HzDJjbnyS/OFzqlix0='
```
79 changes: 78 additions & 1 deletion aspnetcore/release-notes/aspnetcore-11/includes/blazor.md
Original file line number Diff line number Diff line change
@@ -1 +1,78 @@
*Release notes appear in this section as preview features become available.*
### New `DisplayName` component and support for `[Display]` and `[DisplayName]` attributes

<!-- UPDATE 11.0 - API cross-link

<xref:Microsoft.AspNetCore.Components.Forms.DisplayName%601>
-->
The `DisplayName` component can be used to display property names from metadata attributes:

```csharp
[Required, DisplayName("Production Date")]
public DateTime ProductionDate { get; set; }
```

The [`[Display]` attribute](xref:System.ComponentModel.DataAnnotations.DisplayAttribute) on the model class property is supported:

```csharp
[Required, Display(Name = "Production Date")]
public DateTime ProductionDate { get; set; }
```

Of the two approaches, the `[Display]` attribute is recommended, which makes additional properties available. The `[Display]` attribute also enables assigning a resource type for localization. When both attributes are present, `[Display]` takes precedence over `[DisplayName]`. If neither attribute is present, the component falls back to the property name.

Use the `DisplayName` component in labels or table headers:

```razor
<label>
<DisplayName For="@(() => Model!.ProductionDate)" />
<InputDate @bind-Value="Model!.ProductionDate" />
</label>
```

### Blazor Web script startup options format now supported for Blazor Server and Blazor WebAssembly scripts

The Blazor Web App script (`blazor.web.js`) options object passed to `Blazor.start()` uses the following format since the release of .NET 8:

```javascript
Blazor.start({
ssr: { ... },
circuit: { ... },
webAssembly: { ... },
});
```

Now, Blazor Server (`blazor.server.js`) and Blazor WebAssembly (`blazor.webassembly.js`) scripts can use the same options format.

The following example shows the prior options format, which remains supported:

```javascript
Blazor.start({
loadBootResource: function (...) {
...
},
});
```

The newly supported options format for the preceding example:

```javascript
Blazor.start({
webAssembly: {
loadBootResource: function (...) {
...
},
},
});
```

For more information, see <xref:blazor/fundamentals/startup#startup-process-and-configuration>.

### New `BasePath` component

Blazor Web Apps can use the new `BasePath` component (`<BasePath />`) to render the app's app base path (`<base href>`) HTML tag automatically. For more information, see <xref:blazor/host-and-deploy/app-base-path>.

### Inline JS event handler removed from the `NavMenu` component

The inline JS event handler that toggles the display of navigation links is no longer present in the `NavMenu` component of the Blazor Web App project template. Apps generated from the project template now use a [collocated JS module](xref:blazor/js-interop/javascript-location#load-a-script-from-an-external-javascript-file-js-collocated-with-a-component) approach to show or hide the navigation bar on the rendered page. The new approach improves [Content Security Policy (CSP) compliance](xref:blazor/security/content-security-policy) because it doesn't require the CSP to include an unsafe hash for the inline JS.

To migrate an existing app to .NET 11, including adopting the new JS module approach for the navigation bar toggler, see <xref:migration/100-to-110>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be an blank line on the end since this is an include?

Copy link
Collaborator Author

@guardrex guardrex Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there should be a newline at the end of every last content line for every file in GH ... thus a blank line showing at the end of every file.

Loading