Skip to content

Commit 6f1b516

Browse files
authored
Merge pull request #17756 from dotnet/master
2 parents e8dc304 + 2cb0d40 commit 6f1b516

7 files changed

Lines changed: 69 additions & 32 deletions

File tree

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,3 @@ This repository contains the conceptual ASP.NET Core documentation hosted at [do
55
API documentation changes are made in the [AspNetApiDocs repository](https://github.com/dotnet/AspNetApiDocs) against the triple slash `///` comments.
66

77
ASP.NET 4.x documentation changes are made in the [dotnet/AspNetDocs repository](https://github.com/dotnet/AspNetDocs).
8-
9-
## Microsoft Open Source Code of Conduct
10-
11-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12-
For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

aspnetcore/blazor/layouts/sample_snapshot/3.x/App2.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
44
</Found>
55
<NotFound>
6-
<LayoutView Layout="typeof(MainLayout)">
6+
<LayoutView Layout="@typeof(MainLayout)">
77
<h1>Page not found</h1>
88
<p>Sorry, there's nothing at this address.</p>
99
</LayoutView>

aspnetcore/host-and-deploy/linux-apache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to set up Apache as a reverse proxy server on CentOS to r
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: shboyer
77
ms.custom: mvc
8-
ms.date: 02/05/2020
8+
ms.date: 04/10/2020
99
uid: host-and-deploy/linux-apache
1010
---
1111
# Host ASP.NET Core on Linux with Apache
@@ -58,7 +58,7 @@ Because requests are forwarded by reverse proxy, use the [Forwarded Headers Midd
5858

5959
Any component that depends on the scheme, such as authentication, link generation, redirects, and geolocation, must be placed after invoking the Forwarded Headers Middleware. As a general rule, Forwarded Headers Middleware should run before other middleware except diagnostics and error handling middleware. This ordering ensures that the middleware relying on forwarded headers information can consume the header values for processing.
6060

61-
Invoke the <xref:Microsoft.AspNetCore.Builder.ForwardedHeadersExtensions.UseForwardedHeaders*> method in `Startup.Configure` before calling <xref:Microsoft.AspNetCore.Builder.AuthAppBuilderExtensions.UseAuthentication*> or similar authentication scheme middleware. Configure the middleware to forward the `X-Forwarded-For` and `X-Forwarded-Proto` headers:
61+
Invoke the <xref:Microsoft.AspNetCore.Builder.ForwardedHeadersExtensions.UseForwardedHeaders*> method at the top of `Startup.Configure` before calling other middleware. Configure the middleware to forward the `X-Forwarded-For` and `X-Forwarded-Proto` headers:
6262

6363
```csharp
6464
// using Microsoft.AspNetCore.HttpOverrides;

aspnetcore/host-and-deploy/linux-nginx.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to setup Nginx as a reverse proxy on Ubuntu 16.04 to forw
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 02/05/2020
8+
ms.date: 04/10/2020
99
uid: host-and-deploy/linux-nginx
1010
---
1111
# Host ASP.NET Core on Linux with Nginx
@@ -79,7 +79,7 @@ Because requests are forwarded by reverse proxy, use the [Forwarded Headers Midd
7979

8080
Any component that depends on the scheme, such as authentication, link generation, redirects, and geolocation, must be placed after invoking the Forwarded Headers Middleware. As a general rule, Forwarded Headers Middleware should run before other middleware except diagnostics and error handling middleware. This ordering ensures that the middleware relying on forwarded headers information can consume the header values for processing.
8181

82-
Invoke the <xref:Microsoft.AspNetCore.Builder.ForwardedHeadersExtensions.UseForwardedHeaders*> method in `Startup.Configure` before calling <xref:Microsoft.AspNetCore.Builder.AuthAppBuilderExtensions.UseAuthentication*> or similar authentication scheme middleware. Configure the middleware to forward the `X-Forwarded-For` and `X-Forwarded-Proto` headers:
82+
Invoke the <xref:Microsoft.AspNetCore.Builder.ForwardedHeadersExtensions.UseForwardedHeaders*> method at the top of `Startup.Configure` before calling other middleware. Configure the middleware to forward the `X-Forwarded-For` and `X-Forwarded-Proto` headers:
8383

8484
```csharp
8585
// using Microsoft.AspNetCore.HttpOverrides;

aspnetcore/mvc/views/view-compilation.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To enable runtime compilation for all environments and configuration modes:
2525

2626
1. Install the [Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation](https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation/) NuGet package.
2727

28-
1. Update the project's `Startup.ConfigureServices` method to include a call to `AddRazorRuntimeCompilation`. For example:
28+
1. Update the project's `Startup.ConfigureServices` method to include a call to <xref:Microsoft.Extensions.DependencyInjection.RazorRuntimeCompilationMvcBuilderExtensions.AddRazorRuntimeCompilation*>. For example:
2929

3030
```csharp
3131
public void ConfigureServices(IServiceCollection services)
@@ -55,29 +55,15 @@ To enable runtime compilation based on the environment and configuration mode:
5555

5656
1. Update the project's `Startup.ConfigureServices` method to include a call to `AddRazorRuntimeCompilation`. Conditionally execute `AddRazorRuntimeCompilation` such that it only runs in Debug mode when the `ASPNETCORE_ENVIRONMENT` variable is set to `Development`:
5757

58-
```csharp
59-
public IWebHostEnvironment Env { get; set; }
60-
61-
public void ConfigureServices(IServiceCollection services)
62-
{
63-
IMvcBuilder builder = services.AddRazorPages();
64-
65-
#if DEBUG
66-
if (Env.IsDevelopment())
67-
{
68-
builder.AddRazorRuntimeCompilation();
69-
}
70-
#endif
71-
72-
// code omitted for brevity
73-
}
74-
```
58+
[!code-csharp[](~/mvc/views/view-compilation/sample/Startup.cs?name=snippet)]
7559

7660
## Additional resources
7761

62+
* [RazorCompileOnBuild and RazorCompileOnPublish](xref:razor-pages/sdk#properties) properties.
7863
* <xref:razor-pages/index>
7964
* <xref:mvc/views/overview>
8065
* <xref:razor-pages/sdk>
66+
* See the [runtimecompilation sample on GitHub](https://github.com/aspnet/samples/tree/master/samples/aspnetcore/mvc/runtimecompilation) for a sample that shows making runtime compilation work across projects.
8167
8268
::: moniker-end
8369

@@ -104,4 +90,4 @@ Build-time compilation is supplemented by runtime compilation of Razor files. AS
10490
* <xref:mvc/views/overview>
10591
* <xref:razor-pages/sdk>
10692

107-
::: moniker-end
93+
::: moniker-end
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using Microsoft.AspNetCore.Builder;
2+
using Microsoft.AspNetCore.Hosting;
3+
using Microsoft.Extensions.Configuration;
4+
using Microsoft.Extensions.DependencyInjection;
5+
using Microsoft.Extensions.Hosting;
6+
7+
#region snippet
8+
public class Startup
9+
{
10+
public Startup(IConfiguration configuration, IWebHostEnvironment env)
11+
{
12+
Configuration = configuration;
13+
Env = env;
14+
}
15+
16+
public IWebHostEnvironment Env { get; set; }
17+
public IConfiguration Configuration { get; }
18+
19+
public void ConfigureServices(IServiceCollection services)
20+
{
21+
IMvcBuilder builder = services.AddRazorPages();
22+
23+
#if DEBUG
24+
if (Env.IsDevelopment())
25+
{
26+
builder.AddRazorRuntimeCompilation();
27+
}
28+
#endif
29+
}
30+
31+
public void Configure(IApplicationBuilder app)
32+
{
33+
if (Env.IsDevelopment())
34+
{
35+
app.UseDeveloperExceptionPage();
36+
}
37+
else
38+
{
39+
app.UseExceptionHandler("/Error");
40+
app.UseHsts();
41+
}
42+
43+
app.UseHttpsRedirection();
44+
app.UseStaticFiles();
45+
46+
app.UseRouting();
47+
48+
app.UseAuthorization();
49+
50+
app.UseEndpoints(endpoints =>
51+
{
52+
endpoints.MapRazorPages();
53+
});
54+
}
55+
}
56+
#endregion

aspnetcore/signalr/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to configure ASP.NET Core SignalR apps.
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: bradyg
77
ms.custom: mvc
8-
ms.date: 12/10/2019
8+
ms.date: 04/12/2020
99
no-loc: [SignalR]
1010
uid: signalr/configuration
1111
---
@@ -25,7 +25,7 @@ As an example, to configure the serializer to not change the casing of property
2525
```csharp
2626
services.AddSignalR()
2727
.AddJsonProtocol(options => {
28-
options.PayloadSerializerOptions.PropertyNamingPolicy = null
28+
options.PayloadSerializerOptions.PropertyNamingPolicy = null;
2929
});
3030
```
3131

@@ -1085,4 +1085,4 @@ HubConnection hubConnection = HubConnectionBuilder.create("https://example.com/m
10851085
* <xref:signalr/messagepackhubprotocol>
10861086
* <xref:signalr/supported-platforms>
10871087

1088-
::: moniker-end
1088+
::: moniker-end

0 commit comments

Comments
 (0)