After i updated my Visual Studio 2019 from v16.2.5 to v16.3.5 some errors occured in my application in every place where i use string concatenation.
Ex:
int x = 5;
string y = x + " years";
What has changed? How does the Culture influences int?

I think you might have ticked the treat warnings as errors radio button.
An int can be displayed in western digits (0, 1, 2, 3, ... 9) or it can be displayed in other digits such as Arabic (٠ ١ ٢ ٣) or Thai (๑ ๒ ๓) and so on.
Therefor, an int representation is culture dependent, and hence the error.
For more information, check out official documentation.
This message stems from the code analysis feature of Visual Studio. For more info regarding this specific warning, see the documentation. There it says:
[...] .NET members choose default culture and formatting based on assumptions that might not be correct for your code. To make sure that the code works as expected for your scenarios, you should supply culture-specific information according to the following guidelines: [...]
It's generally good practice to be mindful of .ToString calls that end up being show to the user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With