'.NET Framework web app input allows comma decimal separator in one server, but not the other

There are 2 Windows Server 2012 servers with IIS.

Same .NET Framework web application is hosted on both of them.

Application web.config has globalization set to lt-LT.

Application has no other globalization explicitly set.

Both servers return decimal symbol as comma (,) (checked with a C# web api that I wrote).

Problem:

on server A when typing a floating point number, say "36,2" into input - validation works

on server B when doing the same - it does not allow comma separator in the input, but it allows a dot (.).

One thing to note: application has custom model binders for decimal/double type, but on server A everything works with and without those custom binders, while on server B it only works. I want inputs to work accept commas without these custom binders.

Things I've checked:

  • application code between branches - didn't find any changes that would cause this
  • IIS settings - everything looks the same
  • server region / locale / separator - both servers have it set to lt-LT (Lithuanian)

What else could I have missed? If code is the same then logically the problem should be cause by server / IIS differences?

I've read something about "load user profile" option in IIS which might be the cause? Haven't found in-depth info about what it does, tho.

Update:

I found this SO post

I checked id and registry info of the user that the app pool is running on. Apparently the decimal separator for that user is a dot, not a comma. I changed it to a comma and now it's working. I presume that the server was configured incorrectly from the start and all users created after that had bad region settings.

I don't understand what the "load user profile" does then. Shouldn't it take those settings and use them? Neither true nor false option changed anything.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source