You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows.System.User.GetDefault method it's stated that this is supported on WinRT Build 20348, Build 22000, Build 22621, Build 26100 only.
This is represented in the Windows.winmd file as well:
Assuming UniversalApiContract version 720896 is v12/10.0.20348.0.
This is a mismatch between the User-class and IUserStatics2 implemented interface:
User-class:
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public static extern User GetDefault();
Must be correlated with IUserStatics2-interface (i.e. if IUserStatics2.GetDefault() is 10.0.20348.0 only, then User.GetDefault has the same restriction).
I don’t think we already have this for older frameworks. In addition, for system WinRT classes, version checking is discouraged to feature checking, which is much harder to guard.
Fair, nevertheless, there is missing API contract information on User.GetDefault.
AliveDevil
changed the title
Bug: Bad/Missing SupportOSVersion on Windows.System.User.GetDefault
Bug: Bad/Missing ContractVersionAttribute on Windows.System.User.GetDefault
Oct 24, 2024
Description
On Windows.System.User.GetDefault method it's stated that this is supported on
WinRT Build 20348, Build 22000, Build 22621, Build 26100
only.This is represented in the Windows.winmd file as well:
Assuming UniversalApiContract version 720896 is v12/10.0.20348.0.
This is a mismatch between the User-class and IUserStatics2 implemented interface:
User-class:
Must be correlated with IUserStatics2-interface (i.e. if IUserStatics2.GetDefault() is 10.0.20348.0 only, then User.GetDefault has the same restriction).
Steps To Reproduce
Repro: sdaujfg.zip
I expect the compiler to warn me on User.GetDefault() that this callsite is unavailable on TargetFrameworkMinVersion.
Expected Behavior
GetDefault should be annotated with
SupportedOSVersion("10.0.20348.0")
, as is annotated on the IUserStatics2-interface in Windows metadata.Version Info
Additional Context
No response
The text was updated successfully, but these errors were encountered: