Skip to content

Commit

Permalink
Merge pull request #34141 from dotnet/main
Browse files Browse the repository at this point in the history
Merge to Live
  • Loading branch information
guardrex authored Nov 15, 2024
2 parents 7133938 + 0a1058b commit 23415e3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 47 deletions.
5 changes: 0 additions & 5 deletions aspnetcore/blazor/tutorials/movie-database-app/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ For Microsoft Azure services, we recommend using *managed identities*. Managed i

If you don't intend to create the demonstration app while reading the article, you can refer to the completed sample app in the [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples). Select the latest version folder in the repository. The sample folder for this tutorial's project is named `BlazorWebAppMovies`.

<!-- UPDATE 9.0 Revert when the framework is patched. -->

> [!CAUTION]
> A regression prevents the .NET 9.0 framework from working for this tutorial series at this time. When examining the code in the sample app or obtaining the sample app to run locally, use the .NET 8 version of the sample in the sample repository's `8.0` folder at this time.
## Article code examples

The line breaks of code examples shown in the ASP.NET Core documentation often don't match line breaks in scaffolded code generated by tooling for an app. This is due to an article publishing limitation. Lines of code in articles are generally limited to 85 characters in length, and we manually adjust the line length using line breaks to satisfy our publishing guidelines.
Expand Down
42 changes: 1 addition & 41 deletions aspnetcore/blazor/tutorials/movie-database-app/part-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,7 @@ In Visual Studio:

* In the **Additional information** dialog, use the following settings:

<!-- UPDATE 9.0 Update after regression is resolved.
Convert this block back over to 9.0 Standard Term Support. -->

> [!CAUTION]
> A regression prevents the .NET 9.0 framework from working for this tutorial series at this time. You can use the 9.0 SDK and the latest version of Visual Studio, but select the **.NET 8.0 (Long Term Support)** framework when creating the app in the following settings.
* **Framework**: Select **.NET 8.0 (Long Term Support)**.
* **Framework**: Select **.NET 9.0 (Standard Term Support)**.
* **Authentication type**: **None**
* **Configure for HTTPS**: Selected
* **Interactive render mode**: **Server**
Expand Down Expand Up @@ -117,18 +111,6 @@ Create a new project:

* In the **Command Palette**, name the project `BlazorWebAppMovies`, including matching the capitalization. Using this exact project name is important to ensure that the namespaces match for code that you copy from the tutorial into the app that you're building.

:::moniker range=">= aspnetcore-9.0"

<!-- UPDATE 9.0 Update after regression is resolved.
Remove this moniker range block to revert. -->

> [!CAUTION]
> A regression prevents the .NET 9.0 framework from working for this tutorial series at this time. You can use the 9.0 SDK and the latest version of Visual Studio Code, but specify the **.NET 8.0 (Long Term Support)** framework in the next step when you create the app.
* Select **Show all template options**. Select **Framework** followed by **.NET 8.0**.

:::moniker-end

* Select **Create project** to create the app.

:::zone-end
Expand All @@ -139,35 +121,13 @@ Confirm that you have the latest [.NET SDK](https://dotnet.microsoft.com/downloa

In a command shell:

:::moniker range=">= aspnetcore-9.0"

* Use the `cd` command to change to the directory to where you want to create the project folder (for example, `cd c:/users/Bernie_Kopell/Documents`).
* Use the [`dotnet new` command](/dotnet/core/tools/dotnet-new) with the [`blazor` project template](/dotnet/core/tools/dotnet-new-sdk-templates#blazor) to create a new Blazor Web App project. The [`-o|--output` option](/dotnet/core/tools/dotnet-new#options) passed to the command creates the project in a new folder at the current shell directory location. Name the project `BlazorWebAppMovies`, including matching the capitalization, so the namespaces match for code that you copy from the tutorial to the app.

<!-- UPDATE 9.0 Update after regression is resolved.
Remove the 9.0 moniker block, leaving the <9.0
content in place. -->

> [!CAUTION]
> A regression prevents the .NET 9.0 framework from working for this tutorial series at this time. You can use the 9.0 SDK, but specify the **.NET 8.0 (Long Term Support)** framework by passing `net8.0` to the framework option (`-f|--framework`) of the `dotnet new` command when creating the app.
```dotnetcli
dotnet new blazor -o BlazorWebAppMovies -f net8.0
```

:::moniker-end

:::moniker range="< aspnetcore-9.0"

* Use the `cd` command to change to the directory to where you want to create the project folder (for example, `cd c:/users/Bernie_Kopell/Documents`).
* Use the [`dotnet new` command](/dotnet/core/tools/dotnet-new) with the [`blazor` project template](/dotnet/core/tools/dotnet-new-sdk-templates#blazor) to create a new Blazor Web App project. The [`-o|--output` option](/dotnet/core/tools/dotnet-new#options) passed to the command creates the project in a new folder at the current shell directory location. Name the project `BlazorWebAppMovies`, including matching the capitalization, so the namespaces match for code that you copy from the tutorial to the app.

```dotnetcli
dotnet new blazor -o BlazorWebAppMovies
```

:::moniker-end

:::zone-end

## Run the app
Expand Down
25 changes: 24 additions & 1 deletion aspnetcore/blazor/tutorials/movie-database-app/part-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,30 @@ Add a movie to the database. In the following example, the classic sci-fi movie

![Adding The Matrix movie to the database with the 'Create' component](~/blazor/tutorials/movie-database-app/part-2/_static/create-new.png)

When you select the **:::no-loc text="Create":::** button, the movie data is posted to the server and saved in the database. When the app returns to the `Index` page, the added entity appears:
When you select the **:::no-loc text="Create":::** button, the movie data is posted to the server and saved in the database.

:::moniker range=">= aspnetcore-9.0"

<!-- UPDATE 9.0 Revert when debugger is updated -->

:::zone pivot="vs"

A Visual Studio debugger regression breaks with a <xref:Microsoft.AspNetCore.Components.NavigationException> on the line that navigates back to the `Index` page:

![Debugger regression: A navigation exception is thrown on the NavigateTo call.](~/blazor/tutorials/movie-database-app/part-2/_static/debugger_regression.png)

To resolve this problem until the debugger is updated by a future Visual Studio release:

1. Deselect the checkbox for **Break when this exception type is user-handled**.
2. Select the **Continue** button in the menu bar to continue execution.

The exception won't be thrown when the <xref:Microsoft.AspNetCore.Components.NavigationManager.NavigateTo%2A> method is executed throughout the rest of the tutorial series.

:::zone-end

:::moniker-end

When the app returns to the `Index` page, the added entity appears:

![The Matrix movie shown in the movies 'Index' page](~/blazor/tutorials/movie-database-app/part-2/_static/movie-added.png)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 23415e3

Please sign in to comment.