0

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.

  • LoadUserProfile is used to isolate your applications even further. For example when this option is set to False ( the profile is not loaded ) your application will use the c:\windows\temp folder as its temporary directory. If you have other application pools even they will use the same c:\windows\temp folder. If you set the option to load the user profile the temporary directory will be now change to use the profile’s temporary folder C:\Users\apppooluserid\AppData\Local\Temp. – Bruce Zhang Apr 08 '22 at 05:15

0 Answers0