[CSHARP-2066] Positional operator not working when running inside Docker container Created: 15/Oct/17 Updated: 28/Oct/23 Resolved: 19/Apr/19 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Read Operations |
| Affects Version/s: | 2.4.4 |
| Fix Version/s: | 2.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | John Knoop | Assignee: | Dmitry Lukyanov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Description |
|
This code works great when I run it in a standard .NET Core console app:
But when I run that same console app in a Linux container on my Windows machine, I get this exception:
I've tried with simpler update expressions, like just set a property without any positional operator, and that works, so my conclusion is that it has something to do with the positional operator. |
| Comments |
| Comment by Githook User [ 19/Apr/19 ] |
|
Author: {'name': 'Unknown', 'username': 'johnknoop', 'email': 'knoopjohn@gmail.com'}Message: |
| Comment by John Knoop [ 03/Dec/18 ] |
|
For anyone else who feel they can't wait forever on this, here's a workaround: Set NumberFormat to NumberFormatInfo.InvariantInfo on the CultureInfo of the current thread, and it works as expected. |
| Comment by John Knoop [ 19/Nov/18 ] |
|
I've created a project that let's you reproduce the bug. Just follow the instructions in the readme: https://github.com/johnknoop/mongodb2066 |
| Comment by Vincent Kam (Inactive) [ 08/Oct/18 ] |
| Comment by John Knoop [ 29/Sep/18 ] |
|
For more information, there was a discussion on Google Groups that led up to this: |
| Comment by John Knoop [ 26/Sep/18 ] |
|
Since it's been a year and this ticket hasn't gotten any attention, I decided to clone your repo and do some investigation myself. It turns out, when I use ASP.NET Core request localization in my web app, I get the exception above. But when I disable request localization, everything works. That led me to suspect that there is a string formatting going on somewhere that doesn't use the invariant culture. Once I attached your source code to my project, I was able to observe the behaviour in detail (see image). |