Aspnetcore.docs: Code sample references nonexistent property ApplyCurrentCultureToResponseHeaders

Created on 31 Oct 2019  Â·  13Comments  Â·  Source: dotnet/AspNetCore.Docs

The following code sample appears on this page:

app.UseRequestLocalization(new RequestLocalizationOptions
{
    ApplyCurrentCultureToResponseHeaders = true
});

But the ApplyCurrentCultureToResponseHeaders property described doesn't seem to exist on the RequestLocalizationOptions class, so this code sample fails to build with ASP.NET Core 3.0. The documentation for RequestLocalizationOptions also doesn't reference mention this property.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Source - Docs.ms doc-bug

Most helpful comment

Still nothing in 3.1

All 13 comments

@hishamco please review

But the ApplyCurrentCultureToResponseHeaders property described doesn't seem to exist on the RequestLocalizationOptions class

https://github.com/aspnet/AspNetCore/blob/master/src/Middleware/Localization/src/RequestLocalizationOptions.cs#L90

@grovesNL you're probably missing a package. See https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio#add-package-references-for-removed-assemblies

Thanks for the quick response and link to the property on master. I think this problem still exists in the 3.0 release though.

This happens when I create a new project with dotnet new web -f netcoreapp3.0 and make that single change in Startup.cs.

The .NET Core 3.0.0 release is tagged at https://github.com/aspnet/AspNetCore/commit/aee5e4080331553ea9dfb7fb388b6d72f715bf6a which doesn't include this property as far as I can tell from https://github.com/aspnet/AspNetCore/blob/aee5e4080331553ea9dfb7fb388b6d72f715bf6a/src/Middleware/Localization/src/RequestLocalizationOptions.cs

/cc @pranavkm

The change is in the 5.0.0 branch, which would explain why it isn't working in 3.0.

If is that shall we remove it from docs?

The change is in the 5.0.0 branch, which would explain why it isn't working in 3.0.

AFAIK I already started the PR before 3.0 is release I don't know if there's something changed

We should remove this from the docs if it's not in 3.0

Stange!! I'm not sure why this n't shipped in 3.0, @Rick-Anderson I will create a PR for it

Still nothing in 3.1

Any update on this?!!

@ryanbrandenburg please review

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davisnw picture davisnw  Â·  3Comments

AnthonyMastrean picture AnthonyMastrean  Â·  3Comments

nenmyx picture nenmyx  Â·  3Comments

StevenTCramer picture StevenTCramer  Â·  3Comments

danroth27 picture danroth27  Â·  3Comments