Reputation: 56
I just experienced a very odd issue, and I'm hoping someone can explain why this happened?
I have an app that runs as a windows service, under the local system account.
When running the windows service, calling .ToString()
on a double of say 515.45
, it was returning 515,45
.
This is in spite of my regional settings being set to use a .
as a separator, not a ,
However, when running the exact piece of code through Visual Studio, it correctly returns 515.45
.
I'm trying to understand why the decimal separator would be different through VS and via the Windows Service?
I'm running Windows 8.1 Pro. Region is set to English US, location set to South Africa.
Upvotes: 1
Views: 397
Reputation: 101162
It's because the service runs under a different user than the one you use to run Visual Studio.
You can copy your culture settings to system accounts in the control panel (I don't know if this was changed in Windows 8, but I don't think so).
Upvotes: 1