Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooling Pre6 updates #29796

Merged
merged 3 commits into from
Jul 13, 2023
Merged
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
39 changes: 36 additions & 3 deletions aspnetcore/blazor/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,18 @@ To create a Blazor app on Windows, use the following guidance:

:::moniker-end

* Provide a **Project name** and confirm that the **Location** is correct. Select **Next**.
:::moniker range=">= aspnetcore-8.0"

<!-- UPDATE FOR 8.0 Cross-link SSR -->

* Provide a **Project name** and confirm that the **Location** is correct. To enable interactivity with server-side rendering (SSR), select the **Use interactive server components** checkbox. Select **Next**.

:::moniker-end

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

* Provide a **Project name** and confirm that the **Location** is correct. Select **Next**.

* For a *hosted* Blazor WebAssembly app, select the **ASP.NET Core Hosted** checkbox in the **Additional information** dialog.

:::moniker-end
Expand Down Expand Up @@ -101,6 +109,15 @@ Create a new project:
```dotnetcli
dotnet new blazor -o BlazorApp
```

<!-- UPDATE FOR 8.0 Cross-link SSR -->

To enable interactivity with server-side rendering (SSR), add the `--use-server` option to the command:

```dotnetcli
dotnet new blazor -o BlazorApp --use-server
```

* For a Blazor WebAssembly experience with demonstration code and Bootstrap, execute the following command:

```dotnetcli
Expand Down Expand Up @@ -464,12 +481,26 @@ To create a Blazor app on macOS, use the following guidance:

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

* For a Blazor Web Apps experience (*recommended*), Visual Studio for Mac can't create a Blazor Web App in its UI at this time. Open a command shell with Apple's **Terminal** utility application in macOS's `Applications/Utilities` folder. Change the directory to the location where you want to create the app with the [`ls` command](https://man7.org/linux/man-pages/man1/ls.1.html). For example, use the `ls Desktop` command to change the directory to the desktop. Execute the following command in the command shell:
<!-- UPDATE FOR 8.0 VS4Mac new project guidance -->

* For a Blazor Web Apps experience (*recommended*), Visual Studio for Mac can't create a Blazor Web App in its UI at this time.

Install the [.NET 8.0 Preview SDK](https://dotnet.microsoft.com/download/dotnet/8.0) using the correct macOS installer for your platform architecture (Arm64 or x64). For more information on trusting the ASP.NET Core HTTPS development certificate, see <xref:security/enforcing-ssl#trust-the-aspnet-core-https-development-certificate-on-windows-and-macos>.

Open a command shell with Apple's **Terminal** utility application in macOS's `Applications/Utilities` folder. Change the directory to the location where you want to create the app with the [`ls` command](https://man7.org/linux/man-pages/man1/ls.1.html). For example, use the `ls Desktop` command to change the directory to the desktop. Execute the following command in the command shell:

```dotnetcli
dotnet new blazor -o BlazorApp
```

<!-- UPDATE FOR 8.0 Cross-link SSR -->

To enable interactivity with server-side rendering (SSR), add the `--use-server`option to the command:

```dotnetcli
dotnet new blazor -o BlazorApp --use-server
```

After the app is created, open the project file (`BlazorApp.csproj`) with Visual Studio for Mac.

> [!NOTE]
Expand Down Expand Up @@ -513,14 +544,16 @@ For a Blazor Web App experience (*recommended*), choose the **Blazor Web App** t

* For a hosted Blazor WebAssembly experience, select the **ASP.NET Core Hosted** checkbox.

:::moniker-end
<!-- UPDATE FOR 8.0 Re-enable the next two bullets and the dev cert paragraph for 8.0 after VS4Mac supports creating the app in the UI -->

* In the **Project name** field, name the app `BlazorApp`. Select **Create**.

* Select the **Start Without Debugging** command from the **Debug** menu to run the app *without the debugger*. Run the app with **Debug** > **Start Debugging** or the Run (&#9654;) button to run the app *with the debugger*.

If a prompt appears to trust the development certificate, trust the certificate and continue. The user and keychain passwords are required to trust the certificate. For more information on trusting the ASP.NET Core HTTPS development certificate, see <xref:security/enforcing-ssl#trust-the-aspnet-core-https-development-certificate-on-windows-and-macos>.

:::moniker-end

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

> [!IMPORTANT]
Expand Down
4 changes: 3 additions & 1 deletion aspnetcore/blazor/tutorials/build-a-blazor-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ At the end of this tutorial, you'll have a working todo list app.
Create a new Blazor app named `TodoList` in a command shell:

```dotnetcli
dotnet new blazor -o TodoList
dotnet new blazor -o TodoList --use-server
```

The `-o|--output` option creates a folder for the project. If you've created a folder for the project and the command shell is open in that folder, omit the `-o|--output` option and value to create the project. The `--use-server` option enables interactivity with server-side rendering (SSR).

:::moniker-end

:::moniker range="< aspnetcore-8.0"
Expand Down
28 changes: 7 additions & 21 deletions aspnetcore/blazor/tutorials/signalr-blazor-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ Confirm the **Framework** is .NET 8.0 or later. Select **Create**.
In a command shell, execute the following command:

```dotnetcli
dotnet new blazor -o BlazorSignalRApp
dotnet new blazor -o BlazorSignalRApp --use-server
```

The `-o|--output` option creates a folder for the project. If you've created a folder for the project and the command shell is open in that folder, omit the `-o|--output` option and value to create the project.
The `-o|--output` option creates a folder for the project. If you've created a folder for the project and the command shell is open in that folder, omit the `-o|--output` option and value to create the project. The `--use-server` option enables interactivity with server-side rendering (SSR).

In Visual Studio Code, open the app's project folder.

Expand All @@ -130,9 +130,11 @@ When the dialog appears to add assets to build and debug the app, select **Yes**
Visual Studio for Mac can't create a Blazor Web App in its UI at this time. Open a command shell with Apple's **Terminal** utility application in macOS's `Applications/Utilities` folder. Change the directory to the location where you want to create the app with the [`ls` command](https://man7.org/linux/man-pages/man1/ls.1.html). For example, use the `ls Desktop` command to change the directory to the desktop. Execute the following command in the command shell:

```dotnetcli
dotnet new blazor -o BlazorApp
dotnet new blazor -o BlazorApp --use-server
```

The `-o|--output` option creates a folder for the project. If you've created a folder for the project and the command shell is open in that folder, omit the `-o|--output` option and value to create the project. The `--use-server` option enables interactivity with server-side rendering (SSR).

After the app is created, open the project file (`BlazorApp.csproj`) with Visual Studio for Mac.

> [!NOTE]
Expand Down Expand Up @@ -161,10 +163,10 @@ Open the project by navigating to the project folder and opening the project's s
In a command shell, execute the following command:

```dotnetcli
dotnet new blazor -o BlazorSignalRApp
dotnet new blazor -o BlazorSignalRApp --use-server
```

The `-o|--output` option creates a folder for the project. If you've created a folder for the project and the command shell is open in that folder, omit the `-o|--output` option and value to create the project.
The `-o|--output` option creates a folder for the project. If you've created a folder for the project and the command shell is open in that folder, omit the `-o|--output` option and value to create the project. The `--use-server` option enables interactivity with server-side rendering (SSR).

---

Expand Down Expand Up @@ -261,22 +263,6 @@ using Microsoft.AspNetCore.ResponseCompression;
using BlazorSignalRApp.Hubs;
```

<!-- UPDATE FOR 8.0 (REMOVE THE FOLLOWING) -->

Locate the line that adds services and configuration for Razor components:

```csharp
builder.Services.AddRazorComponents();
```

Chain a call to `AddServerComponents` to `AddRazorComponents`. Change the line to the following:

```csharp
builder.Services.AddRazorComponents().AddServerComponents();
```

<!-- UPDATE FOR 8.0 (END OF REMOVAL) -->

Add Response Compression Middleware services:

```csharp
Expand Down