I looked through the APIs that are marked as UnsupportedOSPlatform("browser") under System.ComponentModel.TypeConverter and to me it seems like all were false positives. I do see a common case where all are using Activator.CreateInstance or Type.GetConstructor which might have been the common pattern where the analyzer is flagging APIs are unsupported. These are the APIs that are marked as not supported:
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs#L121
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs#L132
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs#L472
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptionProvider.cs#L54
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs#L433
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs#L21
@steveisok @eerhardt do you agree that all these should be supported? That is the way it looks to me.
_Originally posted by @safern in https://github.com/dotnet/runtime/pull/43363#discussion_r529247886_
Tagging subscribers to this area: @safern
See info in area-owners.md if you want to be subscribed.
Issue Details
I looked through the APIs that are marked as UnsupportedOSPlatform("browser") under System.ComponentModel.TypeConverter and to me it seems like all were false positives. I do see a common case where all are using Activator.CreateInstance or Type.GetConstructor which might have been the common pattern where the analyzer is flagging APIs are unsupported. These are the APIs that are marked as not supported:
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs#L121
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseManager.cs#L132
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs#L472
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptionProvider.cs#L54
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs#L433
https://github.com/dotnet/runtime/blob/aebd598664e7d931eee19eb1779c0ace5d1c3600/src/libraries/System.ComponentModel.TypeConverter/src/System/Security/Authentication/ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs#L21
@steveisok @eerhardt do you agree that all these should be supported? That is the way it looks to me.
_Originally posted by @safern in https://github.com/dotnet/runtime/pull/43363#discussion_r529247886_
| Author: | buyaa-n |
|---|---|
| Assignees: | - |
| Labels: | `area-System.ComponentModel`, `untriaged` |
| Milestone: | - |
It looks like those should all be supported. I'd like to understand why the tool gave a false positive because:
- Maybe we are missing something by just doing code inspection. And these APIs should really be flagged.
- Maybe there is a bug in the tool, and we marked a bunch of other APIs as unsupported, when really they should be.
_Originally posted by @eerhardt in_ https://github.com/dotnet/runtime/pull/43363#discussion_r529756618
We used the tool to look for PNSE and NotSupportedException. Unfortunately, in the TypeConverter case, NSE is an expected throw and it was missed in review.
I have removed the attributes from TypeDescriptor.CreateInstance, TypeDescriptionProvider.CreateInstance as it was referenced in my PR and causing warnings, remaining APIs ca be handled with this PR
Most helpful comment
We used the tool to look for PNSE and NotSupportedException. Unfortunately, in the TypeConverter case, NSE is an expected throw and it was missed in review.