.NET 8 - Windows Service with format problems on numbers

M74

Member
Joined
Jan 8, 2025
Messages
8
Programming Experience
10+
I started developping a little console application. The result is ok.
Then I changed the application type to a (windows) service.
With the command dotnet publish -o .\publish -c Release -p:PublishSingleFile=true I let create a single exe file.
When I double click this EXE, the code runs in a console window and works as expected without errors.
With sc create "SampleService" binPath="C:\\path\\to\\publish\\SampleService.exe" I let create a windows service.
Now the unexpected: When I start the service, the application works BUT the conversion of numbers is wrong: Should be "44.44", but is converted with comma "44,44"

What is the reason and how to solve this problem?
Thanks in advance for any help.
 
Read about .NET UI culture vs. system culture. Usually the two are the set to be the same, but they can be different where the UI could be using English, but the default OS was installed as French. Interactive apps will default to the UI culture. Services are not interactive.
 
Back
Top Bottom