UWP vs WPF: System.Globalization CultureInfo is different?

Setup:

  • VS2015 C# solution
  • Contains one UWP project
  • Contains one WPF project
  • Both projects declare var ci = new CultureInfo(1)

Question(s):

  • Why does the WPF project find the constructor taking an int, but the UWP project does not?
  • Why does browsing the System.Globalization namespace on msdn state that it should be there, if it's not there for UWP?
  • How can we browse the MSDN APIs that are relevant to a particular target type/profile?
Jon Skeet
people
quotationmark

Yes, basically some members are available on some platforms but not others. Look at the version information for CultureInfo(int) constructor vs CultureInfo.DateTimeFormat in the Version Information section, as an example.

Constructor Version Information:

.NET Framework
Available since 1.1

DateTimeFormat Version Information:

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1

Note the lack of mention of UWP on the constructor docs...

people

See more on this question at Stackoverflow