You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Because string interpolation in C# uses the current culture by default, it might insert commas instead of dots for decimals in some locales. If latitude or longitude contain decimal values, which they do, the URL "/points/..." here won’t match the expected format of the weather API when using a culture with a comma decimal separator (e.g. germany, france, ...).
Using CultureInfo.InvariantCulture ensures the decimal separator is always . and prevents the URL from breaking. To Reproduce
Steps to reproduce the behavior:
Set your system / tool to use one of the affected cultures (e.g. using CultureInfo.CreateSpecificCulture("de-DE")
build the server sample with the tool and invoke a GetForecast call
see it failing bc. it's now (made-up) 28,2 instead of 28.2 which leads to an error response.
Expected behavior
The samples should work everywhere.
Logs
If applicable, add logs to help explain your problem.
Additional context
First raised here in the docs repo, and there was the idea to fix it via this docs pr (see comments). This was closed in favour of #134 (which seems to be upstream for the docs quickstart). I left a comment and was asked to create a follow up issue. This is the follow up issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
Because string interpolation in C# uses the current culture by default, it might insert commas instead of dots for decimals in some locales. If latitude or longitude contain decimal values, which they do, the URL "/points/..." here won’t match the expected format of the weather API when using a culture with a comma decimal separator (e.g. germany, france, ...).
Using CultureInfo.InvariantCulture ensures the decimal separator is always . and prevents the URL from breaking.
To Reproduce
Steps to reproduce the behavior:
CultureInfo.CreateSpecificCulture("de-DE")
28,2
instead of28.2
which leads to an error response.Expected behavior
The samples should work everywhere.
Logs
If applicable, add logs to help explain your problem.
Additional context
First raised here in the docs repo, and there was the idea to fix it via this docs pr (see comments). This was closed in favour of #134 (which seems to be upstream for the docs quickstart). I left a comment and was asked to create a follow up issue. This is the follow up issue.
The text was updated successfully, but these errors were encountered: