Skip to content

Commit d2570c8

Browse files
Merge pull request #24257 from dotnet/main
Merge to Live
2 parents d43b809 + 52bfbd4 commit d2570c8

File tree

16 files changed

+96
-451
lines changed

16 files changed

+96
-451
lines changed

aspnetcore/fundamentals/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ uid: fundamentals/index
1515

1616
This article provides an overview of key topics for understanding how to develop ASP.NET Core apps.
1717

18-
## The Startup class
18+
## Program.cs
1919

2020
The `Startup` class is where:
2121

@@ -26,7 +26,6 @@ Here's a sample `Startup` class:
2626

2727
[!code-csharp[](index/samples_snapshot/3.x/Startup.cs?highlight=3,12)]
2828

29-
For more information, see <xref:fundamentals/startup>.
3029

3130
## Dependency injection (services)
3231

aspnetcore/fundamentals/middleware/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ uid: fundamentals/middleware/index
1111
---
1212
# ASP.NET Core Middleware
1313

14-
::: moniker range=">= aspnetcore-6.0"
14+
:::moniker range=">= aspnetcore-6.0"
1515

1616
By [Rick Anderson](https://twitter.com/RickAndMSFT) and [Steve Smith](https://ardalis.com/)
1717

@@ -221,7 +221,7 @@ app.Map("/level1", level1App => {
221221

222222
<xref:Microsoft.AspNetCore.Builder.MapWhenExtensions.MapWhen%2A> branches the request pipeline based on the result of the given predicate. Any predicate of type `Func<HttpContext, bool>` can be used to map requests to a new branch of the pipeline. In the following example, a predicate is used to detect the presence of a query string variable `branch`:
223223

224-
[!code-csharp[](index/snapshot/Chain/StartupMapWhen.cs?highlight=14-15)]
224+
[!code-csharp[](index/snapshot/Chain60/ProgramMapWhen.cs?highlight=4)]
225225

226226
The following table shows the requests and responses from `http://localhost:1234` using the previous code:
227227

@@ -279,9 +279,9 @@ ASP.NET Core ships with the following middleware components. The *Order* column
279279
* <xref:fundamentals/middleware/extensibility>
280280
* <xref:fundamentals/middleware/extensibility-third-party-container>
281281

282-
::: moniker-end
282+
:::moniker-end
283283

284-
::: moniker range="< aspnetcore-6.0"
284+
:::moniker range="< aspnetcore-6.0"
285285

286286
By [Rick Anderson](https://twitter.com/RickAndMSFT) and [Steve Smith](https://ardalis.com/)
287287

@@ -548,4 +548,4 @@ ASP.NET Core ships with the following middleware components. The *Order* column
548548
* <xref:fundamentals/middleware/extensibility>
549549
* <xref:fundamentals/middleware/extensibility-third-party-container>
550550

551-
::: moniker-end
551+
:::moniker-end

aspnetcore/fundamentals/static-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Directory browsing is disabled by default for security reasons. For more informa
116116

117117
Enable directory browsing with <xref:Microsoft.Extensions.DependencyInjection.DirectoryBrowserServiceExtensions.AddDirectoryBrowser%2A> and <xref:Microsoft.AspNetCore.Builder.DirectoryBrowserExtensions.UseDirectoryBrowser%2A>:
118118

119-
[!code-csharp[](~/fundamentals/static-files/samples/6.x/StaticFilesSample/Program.cs?name=snippet_db&highlight=8,22-27)]
119+
[!code-csharp[](~/fundamentals/static-files/samples/6.x/StaticFilesSample/Program.cs?name=snippet_db&highlight=9,23-37)]
120120

121121
<!-- Select RP Home > Directory browsing -->
122122
The preceding code allows directory browsing of the *wwwroot/images* folder using the URL `https://<hostname>/MyImages`, with links to each file and folder:

aspnetcore/fundamentals/static-files/samples/6.x/StaticFilesSample/Program.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define FECTP // DEFAULT RR RH DB DF DF2 UFS UFS2 TREE FECTP NS
1+
#define DB // DEFAULT RR RH DB DF DF2 UFS UFS2 TREE FECTP NS
22
#if NEVER
33
#elif DEFAULT
44
#region snippet
@@ -94,6 +94,7 @@
9494
#endregion
9595
#elif DB // Directory Browsing
9696
#region snippet_db
97+
using Microsoft.AspNetCore.StaticFiles;
9798
using Microsoft.Extensions.FileProviders;
9899

99100
var builder = WebApplication.CreateBuilder(args);
@@ -115,11 +116,20 @@
115116

116117
app.UseStaticFiles();
117118

119+
var fileProvider = new PhysicalFileProvider(Path.Combine(builder.Environment.WebRootPath, "images"));
120+
var requestPath = "/MyImages";
121+
122+
// Enable displaying browser links.
123+
app.UseStaticFiles(new StaticFileOptions
124+
{
125+
FileProvider = fileProvider,
126+
RequestPath = requestPath
127+
});
128+
118129
app.UseDirectoryBrowser(new DirectoryBrowserOptions
119130
{
120-
FileProvider = new PhysicalFileProvider(
121-
Path.Combine(builder.Environment.WebRootPath, "images")),
122-
RequestPath = "/MyImages"
131+
FileProvider = fileProvider,
132+
RequestPath = requestPath
123133
});
124134

125135
app.UseAuthorization();

aspnetcore/grpc/performance.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,20 @@ The preceding code:
264264
* Attempts to get an array from `ByteString.Memory` with <xref:System.Runtime.InteropServices.MemoryMarshal.TryGetArray%2A?displayProperty=nameWithType>.
265265
* Uses the `ArraySegment<byte>` if it was successfully retrieved. The segment has a reference to the array, offset and count.
266266
* Otherwise, falls back to allocating a new array with `ByteString.ToByteArray()`.
267+
268+
### gRPC services and large binary payloads
269+
270+
gRPC and Protobuf can send and receive large binary payloads. Although binary Protobuf is more efficient than text-based JSON at serializing binary payloads, there are still important performance characteristics to keep in mind when working with large binary payloads.
271+
272+
gRPC is a message-based RPC framework, which means:
273+
274+
* The entire message is loaded into memory before gRPC can send it.
275+
* When the message is received, the entire message is deserialized into memory.
276+
277+
Messages with large binary payloads can allocate byte arrays on the [large object heap](/dotnet/standard/garbage-collection/large-object-heap). Large allocations impact server performance and scalability.
278+
279+
Advice for creating high-performance applications with large binary payloads:
280+
281+
* **Avoid** large binary payloads in gRPC messages. A byte array larger than 85,000 bytes is considered a large object. Keeping below that size avoids allocating on the large object heap.
282+
* **Consider** splitting large binary payloads [using streaming](xref:grpc/client#client-streaming-call). Binary data is chunked and streamed over multiple messages.
283+
* **Consider** not using gRPC for large binary data. HTTP endpoints can be used alongside gRPC services. An HTTP endpoint that supports sending or receiving large files using the stream body is efficient.

aspnetcore/host-and-deploy/visual-studio-publish-profiles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ When publishing to an Azure target, the *.pubxml* file contains your Azure subsc
147147

148148
Sensitive information (like the publish password) is encrypted on a per user/machine level. It's stored in the *Properties/PublishProfiles/{PROFILE NAME}.pubxml.user* file. Because this file can store sensitive information, it shouldn't be checked into source control.
149149

150-
For an overview of how to publish an ASP.NET Core web app, see <xref:host-and-deploy/index>. The MSBuild tasks and targets necessary to publish an ASP.NET Core web app are open-source in the [dotnet/websdk repository](https://github.com/dotnet/websdk).
150+
For an overview of how to publish an ASP.NET Core web app, see <xref:host-and-deploy/index>. The MSBuild tasks and targets necessary to publish an ASP.NET Core web app are open-source in the [dotnet/websdk repository](https://github.com/dotnet/sdk/tree/main/src/WebSdk).
151151

152152
The following commands can use folder, MSDeploy, and [Kudu](https://github.com/projectkudu/kudu/wiki) publish profiles. Because MSDeploy lacks cross-platform support, the following MSDeploy options are supported only on Windows.
153153

@@ -186,7 +186,7 @@ In the preceding examples:
186186
* `dotnet publish` and `dotnet build` support Kudu APIs to publish to Azure from any platform. Visual Studio publish supports the Kudu APIs, but it's supported by WebSDK for cross-platform publish to Azure.
187187
* Don't pass `DeployOnBuild` to the `dotnet publish` command.
188188

189-
For more information, see [Microsoft.NET.Sdk.Publish](https://github.com/dotnet/websdk#microsoftnetsdkpublish).
189+
For more information, see [Microsoft.NET.Sdk.Publish](https://github.com/dotnet/sdk/tree/main/src/WebSdk#microsoftnetsdkpublish).
190190

191191
Add a publish profile to the project's *Properties/PublishProfiles* folder with the following content:
192192

aspnetcore/migration/proper-to-2x/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Migrate from ASP.NET to ASP.NET Core
3-
author: isaac2004
3+
author: isaacrlevin
44
description: Receive guidance for migrating existing ASP.NET MVC or Web API apps to ASP.NET Core.web
55
ms.author: scaddie
66
ms.date: 10/18/2019

aspnetcore/migration/proper-to-2x/membership-to-core-identity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Migrate from ASP.NET Membership authentication to ASP.NET Core 2.0 Identity
3-
author: isaac2004
3+
author: isaacrlevin
44
description: Learn how to migrate existing ASP.NET apps using Membership authentication to ASP.NET Core 2.0 Identity.
55
ms.author: scaddie
66
ms.custom: mvc

aspnetcore/migration/proper-to-2x/mvc2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Migrate from ASP.NET to ASP.NET Core 2.0
3-
author: isaac2004
3+
author: isaacrlevin
44
description: Receive guidance for migrating existing ASP.NET MVC or Web API applications to ASP.NET Core 2.0.
55
ms.author: scaddie
66
ms.custom: mvc

aspnetcore/mvc/views/razor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ By [Rick Anderson](https://twitter.com/RickAndMSFT), [Taylor Mullen](https://twi
1313

1414
Razor is a markup syntax for embedding .NET based code into webpages. The Razor syntax consists of Razor markup, C#, and HTML. Files containing Razor generally have a `.cshtml` file extension. Razor is also found in [Razor component](xref:blazor/components/index) files (`.razor`). Razor syntax is similar to the templating engines of various JavaScript single-page application (SPA) frameworks, such as Angular, React, VueJs, and Svelte. For more information see, <xref:client-side/spa-services>.
1515

16+
[Introduction to ASP.NET Web Programming Using the Razor Syntax](/aspnet/web-pages/overview/getting-started/introducing-razor-syntax-c) provides many samples of programming with Razor syntax. Although the topic was written for ASP.NET rather than ASP.NET Core, most of the samples apply to ASP.NET Core.
17+
1618
## Rendering HTML
1719

1820
The default Razor language is HTML. Rendering HTML from Razor markup is no different than rendering HTML from an HTML file. HTML markup in `.cshtml` Razor files is rendered by the server unchanged.

0 commit comments

Comments
 (0)