I am working on an UWP app that uses some features that aren't available in older versions of Windows 10. Therefore, I need to check if Creators Update is installed.
There is version-checking code in the app using AnalyticsInfo.VersionInfo. However, the latest round of WACK tests gave the following Fail:
FAILED Platform version launch • Error Found: The high OS version validation detected the following errors:
o Failed to stop the app AppName.group.mbb.
o The app Company.AppName_2.3.56045.0_x64__cx08jceyq9bcp failed platform version launch test.
• Impact if not fixed: The app should not use version information to provide functionality that is specific to the OS.
• How to fix: Please use recommended methods to check for available functionality in the OS. See the link below for more information. Operating System Version
I am aware of this question, but would rather fix the Fail if possible. I found advice on MSDN about how to make a UWP app "version adaptive" here.
I now have this code:
using Windows.Foundation.Metadata;
if (ApiInformation.IsMethodPresent("Windows.Networking.Connectivity.ConnectionProfile", "GetNetworkUsageAsync"))
{
//do stuff
}
My Windows version is 1703 15063.483, and GetNetworkUsageAsync is used successfully elsewhere in the code. But the call to IsMethodPresent always returns false.
What is wrong with my code?
And is there a better function to check, to know if Creators Update is installed?
UPDATE: I followed Microsoft guidelines for the above Fail, and changed the version checking from AnalyticsInfo.VersionInfo to Windows.Foundation.Metadata.ApiInformation. The app still fails the WACK test with the same error.
2ND UPDATE:
After updating Windows10 to Creators Update, Build 16251.0, this error disappeared on my computer.