You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/debug.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to debug Blazor apps.
5
5
monikerRange: '>= aspnetcore-3.1'
6
6
ms.author: riande
7
7
ms.custom: mvc
8
-
ms.date: 03/26/2020
8
+
ms.date: 04/16/2020
9
9
no-loc: [Blazor, SignalR]
10
10
uid: blazor/debug
11
11
---
@@ -47,7 +47,7 @@ Debugging requires either of the following browsers:
47
47
48
48
## Enable debugging for Visual Studio and Visual Studio Code
49
49
50
-
Debugging is enabled automatically for new projects that are created using the ASP.NET Core 3.2 Preview 3 or later Blazor WebAssembly project template.
50
+
Debugging is enabled automatically for new projects that are created using the ASP.NET Core 3.2 Preview 3 or later Blazor WebAssembly project template ([current release is 3.2 Preview 4](xref:blazor/get-started)).
51
51
52
52
To enable debugging for an existing Blazor WebAssembly app, update the *launchSettings.json* file in the startup project to include the following `inspectUri` property in each launch profile:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/get-started.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Get started with Blazor by building a Blazor app with the tooling o
5
5
monikerRange: '>= aspnetcore-3.1'
6
6
ms.author: riande
7
7
ms.custom: mvc
8
-
ms.date: 04/09/2020
8
+
ms.date: 04/16/2020
9
9
no-loc: [Blazor, SignalR]
10
10
uid: blazor/get-started
11
11
---
@@ -25,6 +25,12 @@ To get started with Blazor, follow the guidance for your choice of tooling:
25
25
26
26
For information on the two Blazor hosting models, *Blazor WebAssembly* and *Blazor Server*, see <xref:blazor/hosting-models>.
27
27
28
+
1. Install the [Blazor WebAssembly](xref:blazor/hosting-models#blazor-webassembly) preview template by running the following command:
29
+
30
+
```dotnetcli
31
+
dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview4.20210.8
32
+
```
33
+
28
34
1. Create a new project.
29
35
30
36
1. Select **Blazor App**. Select **Next**.
@@ -42,11 +48,11 @@ To get started with Blazor, follow the guidance for your choice of tooling:
42
48
1. Optionally install the [Blazor WebAssembly](xref:blazor/hosting-models#blazor-webassembly) preview template by running the following command:
43
49
44
50
```dotnetcli
45
-
dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview3.20168.3
51
+
dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview4.20210.8
46
52
```
47
53
48
54
> [!NOTE]
49
-
> The [.NET Core SDK version 3.1.201 or later](https://dotnet.microsoft.com/download/dotnet-core/3.1) is **required** to use the 3.2 Preview 3 Blazor WebAssembly template. Confirm the installed .NET Core SDK version by running `dotnet --version` in a command shell.
55
+
> The [.NET Core SDK version 3.1.201 or later](https://dotnet.microsoft.com/download/dotnet-core/3.1) is **required** to use the 3.2 Preview 4 Blazor WebAssembly template. Confirm the installed .NET Core SDK version by running `dotnet --version` in a command shell.
50
56
51
57
1. Install [Visual Studio Code](https://code.visualstudio.com/).
52
58
@@ -105,11 +111,11 @@ If a prompt appears to trust the development certificate, trust the certificate
105
111
1. Optionally install the [Blazor WebAssembly](xref:blazor/hosting-models#blazor-webassembly) preview template by running the following command:
106
112
107
113
```dotnetcli
108
-
dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview3.20168.3
114
+
dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview4.20210.8
109
115
```
110
116
111
117
> [!NOTE]
112
-
> The [.NET Core SDK version 3.1.201 or later](https://dotnet.microsoft.com/download/dotnet-core/3.1) is **required** to use the 3.2 Preview 3 Blazor WebAssembly template. Confirm the installed .NET Core SDK version by running `dotnet --version` in a command shell.
118
+
> The [.NET Core SDK version 3.1.201 or later](https://dotnet.microsoft.com/download/dotnet-core/3.1) is **required** to use the 3.2 Preview 4 Blazor WebAssembly template. Confirm the installed .NET Core SDK version by running `dotnet --version` in a command shell.
113
119
114
120
1. For a Blazor Server experience, execute the following commands in a command shell:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/hosting-model-configuration.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn about Blazor hosting model configuration, including how to in
5
5
monikerRange: '>= aspnetcore-3.1'
6
6
ms.author: riande
7
7
ms.custom: mvc
8
-
ms.date: 04/07/2020
8
+
ms.date: 04/16/2020
9
9
no-loc: [Blazor, SignalR]
10
10
uid: blazor/hosting-model-configuration
11
11
---
@@ -62,7 +62,7 @@ Obtain the app's environment in a component by injecting `IWebAssemblyHostEnviro
62
62
63
63
### Configuration
64
64
65
-
As of the ASP.NET Core 3.2 Preview 3 release, Blazor WebAssembly supports configuration from:
65
+
As of the ASP.NET Core 3.2 Preview 3 release ([current release is 3.2 Preview 4](xref:blazor/get-started)), Blazor WebAssembly supports configuration from:
Copy file name to clipboardExpand all lines: aspnetcore/client-side/bundling-and-minification.md
+3-131Lines changed: 3 additions & 131 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ author: scottaddie
4
4
description: Learn how to optimize static resources in an ASP.NET Core web application by applying bundling and minification techniques.
5
5
ms.author: scaddie
6
6
ms.custom: mvc
7
-
ms.date: 06/17/2019
7
+
ms.date: 04/15/2020
8
8
uid: client-side/bundling-and-minification
9
9
---
10
10
# Bundle and minify static assets in ASP.NET Core
@@ -57,7 +57,7 @@ Browsers are fairly verbose with regard to HTTP request headers. The total bytes
57
57
58
58
## Choose a bundling and minification strategy
59
59
60
-
The MVC and Razor Pages project templates provide an out-of-the-box solution for bundling and minification consisting of a JSON configuration file. Third-party tools, such as the [Grunt](xref:client-side/using-grunt) task runner, accomplish the same tasks with a bit more complexity. A third-party tool is a great fit when your development workflow requires processing beyond bundling and minification—such as linting and image optimization. By using design-time bundling and minification, the minified files are created prior to the app's deployment. Bundling and minifying before deployment provides the advantage of reduced server load. However, it's important to recognize that design-time bundling and minification increases build complexity and only works with static files.
60
+
The MVC and Razor Pages project templates provide a solution for bundling and minification consisting of a JSON configuration file. Third-party tools, such as the [Grunt](xref:client-side/using-grunt) task runner, accomplish the same tasks with a bit more complexity. A third-party tool is a great fit when your development workflow requires processing beyond bundling and minification—such as linting and image optimization. By using design-time bundling and minification, the minified files are created prior to the app's deployment. Bundling and minifying before deployment provides the advantage of reduced server load. However, it's important to recognize that design-time bundling and minification increases build complexity and only works with static files.
*`sourceMap`: Flag indicating whether to generate a source map for the bundled file. **optional**, *default - false*
91
91
*`sourceMapRootPath`: The root path for storing the generated source map file.
92
92
93
-
## Build-time execution of bundling and minification
94
-
95
-
The [BuildBundlerMinifier](https://www.nuget.org/packages/BuildBundlerMinifier/) NuGet package enables the execution of bundling and minification at build time. The package injects [MSBuild Targets](/visualstudio/msbuild/msbuild-targets) which run at build and clean time. The *bundleconfig.json* file is analyzed by the build process to produce the output files based on the defined configuration.
96
-
97
-
> [!NOTE]
98
-
> BuildBundlerMinifier belongs to a community-driven project on GitHub for which Microsoft provides no support. Issues should be filed [here](https://github.com/madskristensen/BundlerMinifier/issues).
99
-
100
-
# [Visual Studio](#tab/visual-studio)
101
-
102
-
Add the *BuildBundlerMinifier* package to your project.
103
-
104
-
Build the project. The following appears in the Output window:
105
-
106
-
```console
107
-
1>------ Build started: Project: BuildBundlerMinifierApp, Configuration: Debug Any CPU ------
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
169
-
Copyright (C) Microsoft Corporation. All rights reserved.
170
-
171
-
172
-
Bundler: Cleaning output from bundleconfig.json
173
-
Bundler: Done cleaning output file from bundleconfig.json
174
-
```
175
-
176
-
---
177
-
178
-
## Ad hoc execution of bundling and minification
179
-
180
-
It's possible to run the bundling and minification tasks on an ad hoc basis, without building the project. Add the [BundlerMinifier.Core](https://www.nuget.org/packages/BundlerMinifier.Core/) NuGet package to your project:
> BundlerMinifier.Core belongs to a community-driven project on GitHub for which Microsoft provides no support. Issues should be filed [here](https://github.com/madskristensen/BundlerMinifier/issues).
186
-
187
-
This package extends the .NET Core CLI to include the *dotnet-bundle* tool. The following command can be executed in the Package Manager Console (PMC) window or in a command shell:
188
-
189
-
```dotnetcli
190
-
dotnet bundle
191
-
```
192
-
193
-
> [!IMPORTANT]
194
-
> NuGet Package Manager adds dependencies to the *.csproj file as `<PackageReference />` nodes. The `dotnet bundle` command is registered with the .NET Core CLI only when a `<DotNetCliToolReference />` node is used. Modify the *.csproj file accordingly.
195
-
196
93
## Add files to workflow
197
94
198
95
Consider an example in which an additional *custom.css* file is added resembling the following:
@@ -252,32 +149,7 @@ The following `environment` tag renders the bundled and minified CSS files when
252
149
253
150
There are cases in which an app's bundling and minification workflow requires additional processing. Examples include image optimization, cache busting, and CDN asset processing. To satisfy these requirements, you can convert the bundling and minification workflow to use Gulp.
254
151
255
-
### Use the Bundler & Minifier extension
256
-
257
-
The Visual Studio [Bundler & Minifier](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BundlerMinifier) extension handles the conversion to Gulp.
258
-
259
-
> [!NOTE]
260
-
> The Bundler & Minifier extension belongs to a community-driven project on GitHub for which Microsoft provides no support. Issues should be filed [here](https://github.com/madskristensen/BundlerMinifier/issues).
261
-
262
-
Right-click the *bundleconfig.json* file in Solution Explorer and select **Bundler & Minifier** > **Convert To Gulp...**:
263
-
264
-

265
-
266
-
The *gulpfile.js* and *package.json* files are added to the project. The supporting [npm](https://www.npmjs.com/) packages listed in the *package.json* file's `devDependencies` section are installed.
267
-
268
-
Run the following command in the PMC window to install the Gulp CLI as a global dependency:
269
-
270
-
```console
271
-
npm i -g gulp-cli
272
-
```
273
-
274
-
The *gulpfile.js* file reads the *bundleconfig.json* file for the inputs, outputs, and settings.
The ASP.NET Core templates create a .NET Core Generic Host (<xref:Microsoft.Extensions.Hosting.HostBuilder>).
15
+
The ASP.NET Core templates create a .NET Core Generic Host, <xref:Microsoft.Extensions.Hosting.HostBuilder>.
16
16
17
17
## Host definition
18
18
@@ -34,7 +34,7 @@ The host is typically configured, built, and run by code in the `Program` class.
34
34
* Calls a `CreateHostBuilder` method to create and configure a builder object.
35
35
* Calls `Build` and `Run` methods on the builder object.
36
36
37
-
The ASP.NET Core web templates generate the following code to create a host:
37
+
The ASP.NET Core web templates generate the following code to create a Generic Host:
38
38
39
39
```csharp
40
40
publicclassProgram
@@ -53,7 +53,7 @@ public class Program
53
53
}
54
54
```
55
55
56
-
The following code creates a non-HTTP workload with a `IHostedService` implementation added to the DI container.
56
+
The following code creates a Generic Host using non-HTTP workload. The `IHostedService` implementation is added to the DI container:
57
57
58
58
```csharp
59
59
publicclassProgram
@@ -83,6 +83,8 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
83
83
});
84
84
```
85
85
86
+
The preceding code is generated by the ASP.NET Core templates.
87
+
86
88
If the app uses Entity Framework Core, don't change the name or signature of the `CreateHostBuilder` method. The [Entity Framework Core tools](/ef/core/miscellaneous/cli/) expect to find a `CreateHostBuilder` method that configures the host without running the app. For more information, see [Design-time DbContext Creation](/ef/core/miscellaneous/cli/dbcontext-creation).
0 commit comments