From 1c66dfb67fcf2d941bc94f5bb958375f76298854 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 20 Sep 2023 10:13:01 -0400 Subject: [PATCH 1/5] Mulitpart bundling package support 8.0 (#30419) --- .../webassembly-deployment-layout.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly-deployment-layout.md b/aspnetcore/blazor/host-and-deploy/webassembly-deployment-layout.md index c66b2cdb1d21..decafabb4b2e 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly-deployment-layout.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly-deployment-layout.md @@ -10,16 +10,10 @@ uid: blazor/host-and-deploy/webassembly-deployment-layout --- # Deployment layout for ASP.NET Core hosted Blazor WebAssembly apps -This article explains how to enable Blazor WebAssembly deployments in environments that block the download and execution of dynamic-link library (DLL) files. - -:::moniker range=">= aspnetcore-8.0" +This article explains how to enable hosted Blazor WebAssembly deployments in environments that block the download and execution of dynamic-link library (DLL) files. > [!NOTE] -> This guidance addresses environments that block clients from downloading and executing DLLs. In .NET 8 or later, Blazor uses the Webcil file format to address this problem. For more information, see . -> -> Currently, this article focuses on the use of a hosted Blazor WebAssembly app, which remain supported in .NET 8 or later. The article will be updated to include Blazor Web App coverage, which is tracked by [Expand deployment layout guidance for BWA 8.0 (dotnet/AspNetCore.Docs #30312)](https://github.com/dotnet/AspNetCore.Docs/issues/30312). - -:::moniker-end +> This guidance addresses environments that block clients from downloading and executing DLLs. In .NET 8 or later, Blazor uses the Webcil file format to address this problem. For more information, see . Multipart bundling using the experimental NuGet package described by this article isn't supported for Blazor apps in .NET 8 or later. For more information, see [Enhance Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle package to define a custom bundle format (dotnet/aspnetcore #36978)](https://github.com/dotnet/aspnetcore/issues/36978#issuecomment-1439283893). You can use the guidance in this article to create your own multipart bundling NuGet package for .NET 8 or later. Blazor WebAssembly apps require [dynamic-link libraries (DLLs)](/windows/win32/dlls/dynamic-link-libraries) to function, but some environments block clients from downloading and executing DLLs. In a subset of these environments, [changing the file name extension of DLL files (`.dll`)](xref:blazor/host-and-deploy/webassembly#change-the-file-name-extension-of-dll-files) is sufficient to bypass security restrictions, but security products are often able to scan the content of files traversing the network and block or quarantine DLL files. This article describes one approach for enabling Blazor WebAssembly apps in these environments, where a multipart bundle file is created from the app's DLLs so that the DLLs can be downloaded together bypassing security restrictions. @@ -38,12 +32,15 @@ The approach demonstrated in this article serves as a starting point for develop ## Experimental NuGet package and sample app -The approach described in this article is used by the *experimental* [`Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` package (NuGet.org)](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle). The package contains MSBuild targets to customize the Blazor publish output and a [JavaScript initializer](xref:blazor/js-interop/index#javascript-initializers) to use a custom [boot resource loader](xref:blazor/fundamentals/startup#load-boot-resources), each of which are described in detail later in this article. + + +The approach described in this article is used by the *experimental* [`Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` package (NuGet.org)](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle) for .NET 6 and 7 apps. The package contains MSBuild targets to customize the Blazor publish output and a [JavaScript initializer](xref:blazor/js-interop/index#javascript-initializers) to use a custom [boot resource loader](xref:blazor/fundamentals/startup#load-boot-resources), each of which are described in detail later in this article. [Experimental code (includes the NuGet package reference source and `CustomPackagedApp` sample app)](https://github.com/aspnet/AspLabs/tree/main/src/BlazorWebAssemblyCustomInitialization) > [!WARNING] -> Experimental and preview features are provided for the purpose of collecting feedback and aren't supported for production use. For more information and to provide feedback to the ASP.NET Core product unit, see [Consider releasing a supported version of `Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` (dotnet/aspnetcore #36978)](https://github.com/dotnet/aspnetcore/issues/36978). +> Experimental and preview features are provided for the purpose of collecting feedback and aren't supported for production use. Later in this article, the [Customize the Blazor WebAssembly loading process via a NuGet package](#customize-the-blazor-webassembly-loading-process-via-a-nuget-package) section with its three subsections provide detailed explanations on the configuration and code in the `Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` package. The detailed explanations are important to understand when you create your own strategy and custom loading process for Blazor WebAssembly apps. To use the published, experimental, unsupported NuGet package without customization as a **local demonstration**, perform the following steps: @@ -60,7 +57,7 @@ Later in this article, the [Customize the Blazor WebAssembly loading process via ## Customize the Blazor WebAssembly loading process via a NuGet package > [!WARNING] -> The guidance in this section with its three subsections pertains to building a NuGet package from scratch to implement your own strategy and custom loading process. The *experimental* [`Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` package (NuGet.org)](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle) is based on the guidance in this section. When using the provided package in a **local demonstration** of the multipart bundle download approach, you don't need to follow the guidance in this section. For guidance on how to use the provided package, see the [Experimental NuGet package and sample app](#experimental-nuget-package-and-sample-app) section. +> The guidance in this section with its three subsections pertains to building a NuGet package from scratch to implement your own strategy and custom loading process. The *experimental* [`Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle` package (NuGet.org)](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.MultipartBundle) for .NET 6 and 7 is based on the guidance in this section. When using the provided package in a **local demonstration** of the multipart bundle download approach, you don't need to follow the guidance in this section. For guidance on how to use the provided package, see the [Experimental NuGet package and sample app](#experimental-nuget-package-and-sample-app) section. Blazor app resources are packed into a multipart bundle file and loaded by the browser via a custom [JavaScript (JS) initializer](xref:blazor/js-interop/index#javascript-initializers). For an app consuming the package with the JS initializer, the app only requires that the bundle file is served when requested. All of the other aspects of this approach are handled transparently. From 2ae517752b60749367e6f61c0b0929b673aea3cb Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 21 Sep 2023 06:05:48 -0400 Subject: [PATCH 2/5] Update API (#30428) --- aspnetcore/blazor/components/js-spa-frameworks.md | 6 +++--- aspnetcore/blazor/components/render-modes.md | 4 ++-- aspnetcore/blazor/fundamentals/signalr.md | 2 +- aspnetcore/blazor/project-structure.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aspnetcore/blazor/components/js-spa-frameworks.md b/aspnetcore/blazor/components/js-spa-frameworks.md index 8ed649c40d07..fe7dcf9dd149 100644 --- a/aspnetcore/blazor/components/js-spa-frameworks.md +++ b/aspnetcore/blazor/components/js-spa-frameworks.md @@ -49,7 +49,7 @@ The following example demonstrates the dynamic registration of the preceding `Qu :::moniker range=">= aspnetcore-8.0" -* In a Blazor Web App app, modify the call to in the server-side `Program` file: +* In a Blazor Web App app, modify the call to in the server-side `Program` file: ```csharp builder.Services.AddRazorComponents() @@ -228,7 +228,7 @@ Add a package reference for [`Microsoft.AspNetCore.Components.CustomElements`](h ### Blazor Web App registration -To register a root component as a custom element in a Blazor Web App, modify the call to in the server-side `Program` file. The following example registers the `Counter` component with the custom HTML element `my-counter`: +To register a root component as a custom element in a Blazor Web App, modify the call to in the server-side `Program` file. The following example registers the `Counter` component with the custom HTML element `my-counter`: ## Breaking changes and security advisories From c5f15340e985e45431d5976b2f08df8806aed6c1 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Thu, 21 Sep 2023 08:10:13 -1000 Subject: [PATCH 4/5] Aad rename (#30424) * AD rename /4 * never * Update aspnetcore/security/authentication/azure-ad-b2c.md Co-authored-by: Tom Dykstra --------- Co-authored-by: Tom Dykstra --- aspnetcore/security/authentication/azure-ad-b2c.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/security/authentication/azure-ad-b2c.md b/aspnetcore/security/authentication/azure-ad-b2c.md index 2291db80b188..83ef19bd9f12 100644 --- a/aspnetcore/security/authentication/azure-ad-b2c.md +++ b/aspnetcore/security/authentication/azure-ad-b2c.md @@ -17,7 +17,7 @@ By [Damien Bod](https://twitter.com/damien_bod) > Microsoft Entra ID (previously known as Azure AD) and Azure AD B2C are separate product offerings. An Entra ID tenant generally represents an organization, while an Azure AD B2C tenant represents a collection of identities to be used with relying party applications. To learn more, see [Azure AD B2C: Frequently asked questions (FAQ)](/azure/active-directory-b2c/active-directory-b2c-faqs). > [!TIP] -> [Microsoft Entra External ID for customers](/azure/active-directory/external-identities/customers/overview-customers-ciam) is Microsoft’s new customer identity and access management (CIAM) solution +> [Microsoft Entra External ID for customers](/azure/active-directory/external-identities/customers/overview-customers-ciam) is Microsoft’s new customer identity and access management (CIAM) solution. In this tutorial, you'll learn how to configure an ASP.NET Core app for authentication with Azure AD B2C. @@ -41,7 +41,7 @@ In this tutorial, you'll learn how to configure an ASP.NET Core app for authenti > You may prefer to [use Visual Studio to create your app](/visualstudio/ide/quickstart-aspnet-core). 1. [Create a web app registration in the tenant](/azure/active-directory-b2c/tutorial-register-applications#register-a-web-application). For **Redirect URI**, use `https://localhost:5001/signin-oidc`. Replace `5001` with the port used by your app when using Visual Studio generated ports. - + ## Modify the app 1. Add the `Microsoft.Identity.Web` and `Microsoft.Identity.Web.UI` packages to the project. If you're using Visual Studio, you can use [NuGet Package Manager](/nuget/consume-packages/install-use-packages-visual-studio). From c802e787f796e44412f09be8b0ee7145a9e06182 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Fri, 22 Sep 2023 09:39:49 +0800 Subject: [PATCH 5/5] Add note to C-core migration about non-ASP.NET Core SDKs (#30415) Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> --- aspnetcore/grpc/aspnetcore.md | 2 ++ aspnetcore/grpc/migration.md | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/aspnetcore/grpc/aspnetcore.md b/aspnetcore/grpc/aspnetcore.md index 235850707409..191f188aa3fd 100644 --- a/aspnetcore/grpc/aspnetcore.md +++ b/aspnetcore/grpc/aspnetcore.md @@ -260,6 +260,7 @@ You can add a gRPC server to non-ASP.NET Core projects with the following projec The preceding project file: +* Doesn't use `Microsoft.NET.SDK.Web` as the SDK. * Adds a framework reference to `Microsoft.AspNetCore.App`. * The framework reference allows non-ASP.NET Core apps, such as Windows Services, WPF apps, or WinForms apps to use ASP.NET Core APIs. * The app can now use ASP.NET Core APIs to start an ASP.NET Core server. @@ -268,6 +269,7 @@ The preceding project file: * `.proto` file. For more information about using the `Microsoft.AspNetCore.App` framework reference, see [Use the ASP.NET Core shared framework](xref:fundamentals/target-aspnetcore#use-the-aspnet-core-shared-framework). + ## Integration with ASP.NET Core APIs gRPC services have full access to the ASP.NET Core features such as [Dependency Injection](xref:fundamentals/dependency-injection) (DI) and [Logging](xref:fundamentals/logging/index). For example, the service implementation can resolve a logger service from the DI container via the constructor: diff --git a/aspnetcore/grpc/migration.md b/aspnetcore/grpc/migration.md index 65e43d888b69..19b1d4a5f50f 100644 --- a/aspnetcore/grpc/migration.md +++ b/aspnetcore/grpc/migration.md @@ -113,6 +113,14 @@ ASP.NET Core [middleware](xref:fundamentals/middleware/index) offers similar fun For more information on how these features compare to each other, see [gRPC Interceptors versus Middleware](xref:grpc/interceptors#grpc-interceptors-versus-middleware). +## Host gRPC in non-ASP.NET Core projects + +A C-core-based server can be added to any project type. gRPC for .NET server requires ASP.NET Core. ASP.NET Core is usually available because the project file specifies `Microsoft.NET.SDK.Web` as the SDK. + +A gRPC server can be hosted to non-ASP.NET Core projects by adding `` to a project. The framework reference makes ASP.NET Core APIs available and they can be used to start an ASP.NET Core server. + +For more information, see [Host gRPC in non-ASP.NET Core projects](xref:grpc/aspnetcore#host-grpc-in-non-aspnet-core-projects). + ## Additional resources *