2017-04-18 07:52:04 +08:00
## Calling Attribute.GetCustomAttributes on an indexer property no longer throws AmbiguousMatchException if the ambiguity can be resolved by index's type
2017-04-06 04:52:19 +08:00
### Scope
Edge
### Version Introduced
4.6
### Source Analyzer Status
Available
### Change Description
2017-04-21 02:19:05 +08:00
Prior to the .NET Framework 4.6, calling `GetCustomAttribute(s)` on an indexer
property which differed from another property only by the type of the index
would result in an
< xref:System.Reflection.AmbiguousMatchException ? displayProperty = name > . Beginning
in the .NET Framework 4.6, the property's attributes will be correctly returned.
2017-04-06 04:52:19 +08:00
- [ ] Quirked
- [ ] Build-time break
### Recommended Action
2017-04-21 02:19:05 +08:00
Be aware that GetCustomAttribute(s) will work more frequently now. If an app was previously relying on the < xref:System.Reflection.AmbiguousMatchException ? displayProperty = name > , reflection should now be used to explicitly look for multiple indexers, instead.
2017-04-06 04:52:19 +08:00
### Affected APIs
* `M:System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo,System.Type)`
* `M:System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo,System.Type,System.Boolean)`
* `M:System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)`
* `M:System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo,System.Boolean)`
* `M:System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo,System.Type)`
* `M:System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo,System.Type,System.Boolean)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttribute(System.Reflection.MemberInfo,System.Type)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttribute(System.Reflection.MemberInfo,System.Type,System.Boolean)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttribute``1(System.Reflection.MemberInfo)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttribute``1(System.Reflection.MemberInfo,System.Boolean)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.MemberInfo)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.MemberInfo,System.Boolean)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.MemberInfo,System.Type)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.MemberInfo,System.Type,System.Boolean)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttributes``1(System.Reflection.MemberInfo)`
* `M:System.Reflection.CustomAttributeExtensions.GetCustomAttributes``1(System.Reflection.MemberInfo,System.Boolean)`
### Category
2017-04-18 07:52:04 +08:00
Core
<!-- breaking change id: 112 -->