dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.68k stars 1.06k forks source link

Many warnings "has a resource with the locale 'de'. This locale is not recognized by .NET" #37636

Open jakubch1 opened 9 months ago

jakubch1 commented 9 months ago

Our CI build is producing many warnings like this:

/__w/1/s/.dotnet/sdk/9.0.100-alpha.1.23615.4/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): warning NETSDK1188: Package Microsoft.Testing.Platform 1.0.0-preview.23621.6 has a resource with the locale 'cs'. This locale is not recognized by .NET. Consider notifying the package author that it appears to be using an invalid locale. [/__w/1/s/tests/Microsoft.CodeCoverage.Analysis.Tests/Microsoft.CodeCoverage.Analysis.Tests.csproj::TargetFramework=net9.0]
##[warning].dotnet/sdk/9.0.100-alpha.1.23615.4/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): warning NETSDK1188: (NETCORE_ENGINEERING_TELEMETRY=Build) Package Microsoft.Testing.Platform 1.0.0-preview.23621.6 has a resource with the locale 'cs'. This locale is not recognized by .NET. Consider notifying the package author that it appears to be using an invalid locale.
/__w/1/s/.dotnet/sdk/9.0.100-alpha.1.23615.4/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): warning NETSDK1188: Package Microsoft.Testing.Platform 1.0.0-preview.23621.6 has a resource with the locale 'de'. This locale is not recognized by .NET. Consider notifying the package author that it appears to be using an invalid locale. [/__w/1/s/tests/Microsoft.CodeCoverage.Analysis.Tests/Microsoft.CodeCoverage.Analysis.Tests.csproj::TargetFramework=net9.0]
##[warning].dotnet/sdk/9.0.100-alpha.1.23615.4/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): warning NETSDK1188: (NETCORE_ENGINEERING_TELEMETRY=Build) Package Microsoft.Testing.Platform 1.0.0-preview.23621.6 has a resource with the locale 'de'. This locale is not recognized by .NET. Consider notifying the package author that it appears to be using an invalid locale.

It is happening only on unix (ubuntu, alpine and macos). Building same code on windows is not causing it. I am also not able to repro it locally. We build our code using arcade infrastructure. Link to example build: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=8840677&view=logs&j=9da81d86-a7e8-53ea-404c-b4879343d50c&t=9ef44dce-4b34-5e1a-8b43-8a202ad719eb&l=77

jakubch1 commented 9 months ago

When building we were setting env var DOTNET_SYSTEM_GLOBALIZATION_INVARIANT to 1. This was causing all above warnings. Probably fix should check for this env var and not generate warnings if set to 1.

ihordyrman commented 7 months ago

We're running into the exact same issue in our solution. We're also using DOTNET_SYSTEM_GLOBALIZATION_INVARIANT, but still getting a ton of these NETSDK1188 warnings. Here's an example from our logs:

[WRN] /home/gitlab-runner/builds/g_czk3Jmq/0//.nuke/temp/dotnet-unix/sdk/8.0.200/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): warning NETSDK1188: Package Microsoft.CodeAnalysis.CSharp 4.5.0 has a resource with the locale 'pl'. This locale is not recognized by .NET. Consider notifying the package author that it appears to be using an invalid locale. [/home/gitlab-runner/builds/g_czk3Jmq/0/.csproj]

Tried the global <NoWarn>$(NoWarn);NETSDK1188</NoWarn>, but no luck – the warnings are still there and cluttering up our logs.

jorgelaranjo commented 6 months ago

export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0

Worth checking documentation https://learn.microsoft.com/en-us/dotnet/core/runtime-config/globalization

freddyrios commented 1 month ago

Installing&enabling globalization support is not a solution but a workaround.

Specially as we are talking about test platform packagesa. Why would it force you to change the environment to avoid warnings about cultures that are not relevant for the test environment.