Skip to content

ASP.NET Core WebAPI includes InvariantGlobalization setting in .csproj in .NET 8 but is not stated as a change. #52319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
patr543a opened this issue Nov 23, 2023 · 10 comments · Fixed by #52428
Closed
1 task done
Assignees
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework feature-templates
Milestone

Comments

@patr543a
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

<InvariantGlobalization>true</InvariantGlobalization> is included in the .csproj file in ASP.NET Core WebAPI by default in .NET 8 only was never stated as a change.

Expected Behavior

<InvariantGlobalization>true</InvariantGlobalization> should not be in the .csproj by default as is not the case with .NET 7 only .NET 8 and is never ever stated in the changes which gives me the impression this is a bug. This causes issues with Entity Framework Core which i experienced and it took hours before i knew this was the cause because it was never stated as a change at all

Steps To Reproduce

  • Open Visual Studio 2022 Preview
  • Create a new project of ASP.NET Core WebAPI
  • Open .csproj file
  • <InvariantGlobalization>true</InvariantGlobalization> will be in it

Exceptions (if any)

Doesn't really give any exceptions but will cause exceptions like CultureNotFound in Entity Framework Core.

.NET Version

8.0.100

Anything else?

IDE: Version 17.9.0 Preview 1.0
Output of dotnet --info

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.71b9f198

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
 Workload version: 8.0.100-manifests.71b9f198
 [aspire]
   Installation Source: VS 17.9.34310.174
   Manifest Version:    8.0.0-preview.1.23557.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0-preview.1.23557.2\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: VS 17.9.34310.174, VS 17.7.34221.43
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 17.9.34310.174, VS 17.7.34221.43
   Manifest Version:    17.0.8478/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 17.9.34310.174, VS 17.7.34221.43
   Manifest Version:    17.0.8478/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json
   Install Type:              Msi

 [android]
   Installation Source: VS 17.9.34310.174, VS 17.7.34221.43
   Manifest Version:    34.0.43/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json
   Install Type:              Msi

 [maui-maccatalyst]
   Installation Source: VS 17.7.34221.43
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
   Install Type:              Msi

 [maui-ios]
   Installation Source: VS 17.7.34221.43
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
   Install Type:              Msi

 [maui-android]
   Installation Source: VS 17.7.34221.43
   Manifest Version:    8.0.3/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
   Install Type:              Msi


Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  3.1.401 [C:\Program Files\dotnet\sdk]
  7.0.403 [C:\Program Files\dotnet\sdk]
  8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.24 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Nov 23, 2023
@gfoidl
Copy link
Member

gfoidl commented Nov 23, 2023

For reference: #47066 made that change.

@patr543a
Copy link
Author

For reference: #47066 made that change.

I see but it still does not say anything about it in the documentation. So i guess i'll have to go report it there

@gfoidl
Copy link
Member

gfoidl commented Nov 23, 2023

@patr543a just wait a bit...the issue can be moved to docs also, no need to create there a separate one (at the moment).
My comment was solely about giving a reference to the PR that made that change, so triaging this issue may become easier (others don't have to search for the PR).

@eerhardt can you please chime in?

@patr543a
Copy link
Author

Since it seams like nothing seams to be happening here i made a documentation issue post. (I know i was told not to)
You can find the documentation issue post here

@eerhardt
Copy link
Member

This was an intentional change to the web api template. But it wasn't intentional to leave it out of the docs. Thanks for opening the docs issue, @patr543a.

@eerhardt
Copy link
Member

This was an intentional change to the web api template.

After more investigation, this setting was only supposed to be enabled when the template was created for Native AOT mode. See #48238. Looks like we missed a few spots in that PR. Re-opening to fix them.

@eerhardt eerhardt reopened this Nov 28, 2023
@eerhardt eerhardt self-assigned this Nov 28, 2023
eerhardt added a commit to eerhardt/aspnetcore that referenced this issue Nov 28, 2023
These entries were missed in dotnet#48238. InvariantGlobalization should only be set when the template is created for native AOT. That is the way it is for the worker and grpc templates already. These templates don't support AOT.

Fix dotnet#52319
@eerhardt eerhardt added this to the 8.0.1 milestone Nov 28, 2023
eerhardt added a commit that referenced this issue Nov 29, 2023
These entries were missed in #48238. InvariantGlobalization should only be set when the template is created for native AOT. That is the way it is for the worker and grpc templates already. These templates don't support AOT.

Fix #52319
@eerhardt
Copy link
Member

Re-opening to track backporting to 8.0.

@eerhardt eerhardt reopened this Nov 29, 2023
eerhardt added a commit to eerhardt/aspnetcore that referenced this issue Nov 29, 2023
These entries were missed in dotnet#48238. InvariantGlobalization should only be set when the template is created for native AOT. That is the way it is for the worker and grpc templates already. These templates don't support AOT.

Fix dotnet#52319
wtgodbe pushed a commit that referenced this issue Jan 3, 2024
These entries were missed in #48238. InvariantGlobalization should only be set when the template is created for native AOT. That is the way it is for the worker and grpc templates already. These templates don't support AOT.

Fix #52319
Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@eerhardt
Copy link
Member

eerhardt commented Feb 6, 2024

@dotnet-policy-service, this isn't a PR.

But thanks for the reminder. The PR (#52461) has been merged into release/8.0. Closing.

@eerhardt eerhardt closed this as completed Feb 6, 2024
Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@eerhardt eerhardt removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework feature-templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants