Skip to content

Commit

Permalink
Merge pull request #35583 from dotnet/main
Browse files Browse the repository at this point in the history
  • Loading branch information
BillWagner committed Jun 1, 2023
2 parents 113ccec + d676198 commit 76d45cf
Show file tree
Hide file tree
Showing 44 changed files with 723 additions and 629 deletions.
2 changes: 0 additions & 2 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"ul"
]
},
// Allow Bare URLs. We often use them in text.
"MD034": false,
"MD036": false,
"MD040": false,
// Cannot be enabled because of the include folder snippets
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ to clarify expected behavior in our community. For more information, see the [.N
- [![MSDocs build verifier](https://github.com/dotnet/docs/actions/workflows/docs-verifier.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/docs-verifier.yml): Runs various Markdown verifications, beyond the linter, such as ensuring links and redirects are valid.
- [![No response](https://github.com/dotnet/docs/actions/workflows/no-response.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/no-response.yml): If an issue is labeled with `needs-more-info` and the op doesn't respond within 14 days, the issue is closed.
- [![OPS status checker](https://github.com/dotnet/docs/actions/workflows/check-for-build-warnings.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/check-for-build-warnings.yml): Builds the site for the PR in context, and verifies the build reporting either, `success,` `warnings`, or `error`.
- [![Snippets 5000](https://github.com/dotnet/docs/actions/workflows/build-validation.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/build-validation.yml): Custom .NET build validation, locates code impacted by a PR, and builds.
- [![Snippets 5000](https://github.com/dotnet/docs/actions/workflows/snippets5000.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/snippets5000.yml): Custom .NET build validation, locates code impacted by a PR, and builds.
- [![Target supported version](https://github.com/dotnet/docs/actions/workflows/version-sweep.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/version-sweep.yml): Runs monthly, creating issues on projects that target .NET versions that are out of support.
- [![Update dependabot.yml](https://github.com/dotnet/docs/actions/workflows/dependabot-bot.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/dependabot-bot.yml): Automatically updates the `dependabot` configuration weekly, but only if required.
- [![quest import](https://github.com/dotnet/docs/actions/workflows/quest.yml/badge.svg)](https://github.com/dotnet/docs/actions/workflows/quest.yml): Automatically synchronizes issues with Quest (Azure DevOps).
Expand Down
82 changes: 41 additions & 41 deletions docs/azure/includes/dotnet-all.md

Large diffs are not rendered by default.

82 changes: 41 additions & 41 deletions docs/azure/includes/dotnet-new.md

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions docs/core/compatibility/8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,26 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff
## ASP.NET Core

| Title | Type of change | Introduced |
| ----------------------------------------------------------------------------------------------------- | ------------------- | ---------- |
| [ConcurrencyLimiterMiddleware is obsolete](aspnet-core/8.0/concurrencylimitermiddleware-obsolete.md) | Source incompatible | Preview 4 |
| [Custom converters for serialization removed](aspnet-core/8.0/problemdetails-custom-converters.md) | Behavioral change | Preview 2 |
| Title | Type of change | Introduced |
| ---------------------------------------------------------------------------------------------------- | ------------------- | ---------- |
| [ConcurrencyLimiterMiddleware is obsolete](aspnet-core/8.0/concurrencylimitermiddleware-obsolete.md) | Source incompatible | Preview 4 |
| [Custom converters for serialization removed](aspnet-core/8.0/problemdetails-custom-converters.md) | Behavioral change | Preview 2 |
| [ISystemClock is obsolete](aspnet-core/8.0/isystemclock-obsolete.md) | Source incompatible | Preview 5 |
| [Rate-limiting middleware requires AddRateLimiter](aspnet-core/8.0/addratelimiter-requirement.md) | Behavioral change | Preview 5 |

## Core .NET libraries

| Title | Type of change | Introduced |
| ----------------------------------------------------------------------------------------------------- | ------------------- | ---------- |
| [Activity operation name when null](core-libraries/8.0/activity-operation-name.md) | Behavioral change | Preview 1 |
| [AnonymousPipeServerStream.Dispose behavior](core-libraries/8.0/anonymouspipeserverstream-dispose.md) | Behavioral change | Preview 1 |
| Title | Type of change | Introduced |
| --------------------------------------------------------------------------------------------------------- | ------------------- | ------------ |
| [Activity operation name when null](core-libraries/8.0/activity-operation-name.md) | Behavioral change | Preview 1 |
| [AnonymousPipeServerStream.Dispose behavior](core-libraries/8.0/anonymouspipeserverstream-dispose.md) | Behavioral change | Preview 1 |
| [API obsoletions with custom diagnostic IDs](core-libraries/8.0/obsolete-apis-with-custom-diagnostics.md) | Source incompatible | Preview 1, 4 |
| [Backslash mapping in Unix file paths](core-libraries/8.0/file-path-backslash.md) | Behavioral change | Preview 1 |
| [FileStream writes when pipe is closed](core-libraries/8.0/filestream-disposed-pipe.md) | Behavioral change | Preview 1 |
| [GC.GetGeneration might return Int32.MaxValue](core-libraries/8.0/getgeneration-return-value.md) | Behavioral change | Preview 4 |
| [GetFolderPath behavior on Unix](core-libraries/8.0/getfolderpath-unix.md) | Behavioral change | Preview 1 |
| [ITypeDescriptorContext nullable annotations](core-libraries/8.0/itypedescriptorcontext-props.md) | Source incompatible | Preview 1 |
| [Legacy Console.ReadKey removed](core-libraries/8.0/console-readkey-legacy.md) | Behavioral change | Preview 1 |
| [Backslash mapping in Unix file paths](core-libraries/8.0/file-path-backslash.md) | Behavioral change | Preview 1 |
| [FileStream writes when pipe is closed](core-libraries/8.0/filestream-disposed-pipe.md) | Behavioral change | Preview 1 |
| [GC.GetGeneration might return Int32.MaxValue](core-libraries/8.0/getgeneration-return-value.md) | Behavioral change | Preview 4 |
| [GetFolderPath behavior on Unix](core-libraries/8.0/getfolderpath-unix.md) | Behavioral change | Preview 1 |
| [ITypeDescriptorContext nullable annotations](core-libraries/8.0/itypedescriptorcontext-props.md) | Source incompatible | Preview 1 |
| [Legacy Console.ReadKey removed](core-libraries/8.0/console-readkey-legacy.md) | Behavioral change | Preview 1 |

## Cryptography

Expand All @@ -46,7 +48,7 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff
## Deployment

| Title | Type of change | Introduced |
|-------------------------------------------------------------------------|-------------------|------------|
| ----------------------------------------------------------------------- | ----------------- | ---------- |
| [StripSymbols defaults to true](deployment/8.0/stripsymbols-default.md) | Behavioral change | Preview 4 |

## Extensions
Expand All @@ -61,7 +63,7 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff
## Globalization

| Title | Type of change | Introduced |
|---------------------------------------------------------------------------------------------------|-------------------|------------|
| ------------------------------------------------------------------------------------------------- | ----------------- | ---------- |
| [Date and time converters honor culture argument](globalization/8.0/typeconverter-cultureinfo.md) | Behavioral change | Preview 4 |
| [TwoDigitYearMax default is 2049](globalization/8.0/twodigityearmax-default.md) | Behavioral change | Preview 1 |

Expand All @@ -82,9 +84,9 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff

## Serialization

| Title | Type of change | Introduced |
| ------------------------------------------------------------------------------- | ------------------------------------------------ | ---------- |
| [BinaryFormatter disabled for most projects](serialization/8.0/binaryformatter-disabled.md) | Behavioral change | Preview 4 |
| Title | Type of change | Introduced |
| ------------------------------------------------------------------------------------------- | ----------------- | ---------- |
| [BinaryFormatter disabled for most projects](serialization/8.0/binaryformatter-disabled.md) | Behavioral change | Preview 4 |

## Windows Forms

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: "Breaking change: Rate-limiting middleware requires AddRateLimiter"
description: Learn about the breaking change in ASP.NET Core 8.0 where rate-limiting middleware now requires AddRateLimiter to be called on app startup.
ms.date: 05/30/2023
---
# Rate-limiting middleware requires AddRateLimiter

ASP.NET Core rate-limiting middleware has been updated with extra functionality. The middleware now requires services registered with <xref:Microsoft.AspNetCore.Builder.RateLimiterServiceCollectionExtensions.AddRateLimiter%2A>.

## Version introduced

ASP.NET Core 8.0 Preview 5

## Previous behavior

Previously, rate limiting could be used without <xref:Microsoft.AspNetCore.Builder.RateLimiterServiceCollectionExtensions.AddRateLimiter%2A>. For example, the middleware could be configured by calling `Configure<RateLimiterOptions>(o => { })`:

```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.Configure<RateLimiterOptions>(o => o
.AddFixedWindowLimiter(policyName: "fixed", options =>
{
// configuration
}));

var app = builder.Build();
app.UseRateLimiter();
app.MapGet("/", () => Results.Ok($"Hello world")).RequireRateLimiting("fixed");
app.Run();
```

## New behavior

If <xref:Microsoft.AspNetCore.Builder.RateLimiterServiceCollectionExtensions.AddRateLimiter%2A> is not called on app startup, ASP.NET Core throws an informative error:

> Unable to find the required services. Please add all the required services by calling 'IServiceCollection.AddRateLimiter' in the application startup code.
## Type of breaking change

This change is a [behavioral change](../../categories.md#behavioral-change).

## Reason for change

Rate-limiting middleware requires services that are only registered by calling <xref:Microsoft.AspNetCore.Builder.RateLimiterServiceCollectionExtensions.AddRateLimiter%2A>.

## Recommended action

Ensure that <xref:Microsoft.AspNetCore.Builder.RateLimiterApplicationBuilderExtensions.UseRateLimiter%2A> is called at application startup.

For example, update `Configure<RateLimiterOptions>(o => { })` to use <xref:Microsoft.AspNetCore.Builder.RateLimiterApplicationBuilderExtensions.UseRateLimiter%2A>:

```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRateLimiter(o => o
.AddFixedWindowLimiter(policyName: "fixed", options =>
{
// configuration
}));

var app = builder.Build();
app.UseRateLimiter();
app.MapGet("/", () => Results.Ok($"Hello world")).RequireRateLimiting("fixed");
app.Run();
```

## Affected APIs

- <xref:Microsoft.AspNetCore.Builder.RateLimiterApplicationBuilderExtensions.UseRateLimiter%2A?displayProperty=fullName>
Loading

0 comments on commit 76d45cf

Please sign in to comment.