Skip to content

Commit 6cd90c4

Browse files
authored
Update EF Core tooling breaking change
1 parent b25ec3e commit 6cd90c4

File tree

1 file changed

+26
-48
lines changed
  • aspnetcore/blazor/tutorials/movie-database-app

1 file changed

+26
-48
lines changed

aspnetcore/blazor/tutorials/movie-database-app/part-2.md

Lines changed: 26 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ Paste all of the following commands at the prompt (`>`) of the **Terminal**. Whe
119119

120120
When you paste multiple commands, all of the commands execute except the last one. The last command doesn't execute until you press <kbd>Enter</kbd> on the keyboard.
121121

122-
:::moniker range=">= aspnetcore-10.0"
123-
124122
```dotnetcli
125123
dotnet tool install --global dotnet-aspnet-codegenerator
126124
dotnet tool install --global dotnet-ef
@@ -136,56 +134,36 @@ dotnet add package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
136134
> [!IMPORTANT]
137135
> After the first eight commands execute, make sure that you press <kbd>Enter</kbd> on the keyboard to execute the last command.
138136
139-
:::moniker-end
140-
141137
:::moniker range=">= aspnetcore-9.0 < aspnetcore-10.0"
142138

143-
```dotnetcli
144-
dotnet tool install --global dotnet-aspnet-codegenerator
145-
dotnet tool install --global dotnet-ef
146-
dotnet add package Microsoft.EntityFrameworkCore.SQLite
147-
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
148-
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
149-
dotnet add package Microsoft.EntityFrameworkCore.Tools
150-
dotnet add package Microsoft.AspNetCore.Components.QuickGrid
151-
dotnet add package Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter
152-
dotnet add package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
153-
dotnet add package Microsoft.EntityFrameworkCore.Design
154-
```
155-
156-
> [!IMPORTANT]
157-
> After the first nine commands execute, make sure that you press <kbd>Enter</kbd> on the keyboard to execute the last command.
158-
159-
Open the app's project file (`BlazorWebAppMovies.csproj`). Mark the `Microsoft.EntityFrameworkCore.Design` assembly reference as publishable by adding `<Publish>true</Publish>` to the package reference. In the following example, the `{VERSION}` placeholder is the package's version and remains unchanged:
160-
161-
```diff
162-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="{VERSION}">
163-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
164-
<PrivateAssets>all</PrivateAssets>
165-
+ <Publish>true</Publish>
166-
</PackageReference>
167-
```
168-
169-
The preceding update to the package reference is a workaround for a breaking change in .NET 9 EF Core tooling. The change to the package reference can be reverted in apps that are eventually updated to .NET 10 or later. For more information, see [Breaking changes in EF Core 9 (EF9)](/ef/core/what-is-new/ef-core-9.0/breaking-changes#microsoftentityframeworkcoredesign-not-found-when-using-ef-tools).
170-
171-
:::moniker-end
172-
173-
:::moniker range="< aspnetcore-9.0"
174-
175-
```dotnetcli
176-
dotnet tool install --global dotnet-aspnet-codegenerator
177-
dotnet tool install --global dotnet-ef
178-
dotnet add package Microsoft.EntityFrameworkCore.SQLite
179-
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
180-
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
181-
dotnet add package Microsoft.EntityFrameworkCore.Tools
182-
dotnet add package Microsoft.AspNetCore.Components.QuickGrid
183-
dotnet add package Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter
184-
dotnet add package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
185-
```
139+
<!-- UPDATE 10.0 - Update the first bullet. -->
186140

187141
> [!IMPORTANT]
188-
> After the first eight commands execute, make sure that you press <kbd>Enter</kbd> on the keyboard to execute the last command.
142+
> If using the .NET 9 SDK, a breaking change in EF Core tooling prevents scaffolding from executing with the following exception:
143+
>
144+
> > :::no-loc text="Could not load file or assembly 'Microsoft.EntityFrameworkCore.Design, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.":::
145+
>
146+
> Adopt ***either*** of the following approaches:
147+
>
148+
> * Use a .NET SDK for .NET 10 or later. .NET 10 is currently in preview and is secheduled for release in November, 2025.
149+
>
150+
> * Add a package reference to the app for the [`Microsoft.EntityFrameworkCore.Design`](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Design) NuGet package:
151+
>
152+
> ```dotnetcli
153+
> dotnet add package Microsoft.EntityFrameworkCore.Design
154+
> ```
155+
>
156+
> Open the app's project file (`BlazorWebAppMovies.csproj`). Mark the `Microsoft.EntityFrameworkCore.Design` assembly reference as publishable by adding `<Publish>true</Publish>` to the package reference. In the following example, the `{VERSION}` placeholder is the package's version and remains unchanged:
157+
>
158+
> ```diff
159+
> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="{VERSION}">
160+
> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
161+
> <PrivateAssets>all</PrivateAssets>
162+
> + <Publish>true</Publish>
163+
> </PackageReference>
164+
> ```
165+
>
166+
> The preceding update to the package reference is a workaround for a breaking change in .NET 9 EF Core tooling. The change to the package reference can be reverted in apps that are eventually updated to .NET 10 or later. For more information, see [Breaking changes in EF Core 9 (EF9)](/ef/core/what-is-new/ef-core-9.0/breaking-changes#microsoftentityframeworkcoredesign-not-found-when-using-ef-tools).
189167
190168
:::moniker-end
191169

0 commit comments

Comments
 (0)