Skip to content

Commit 34919bc

Browse files
Merge pull request #13 from Taylormsz/aspnet48compat
compat doc for bug#563497
2 parents fbae110 + cb2cff4 commit 34919bc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## ASP.NET ValidationContext.MemberName is not NULL when using custom DataAnnotations.ValidationAttribute
2+
3+
### Version Introduced
4+
4.8
5+
6+
### Change Description
7+
When using custom `DataAnnotations.ValidationAttribute`, `System.ComponentModel.DataAnnotations.ValidationContext.MemberName` returns null. This issue is fixed in .NET 4.8.
8+
9+
10+
### Recommended Action
11+
Starting from .NET 4.8, the default behavior stays the same. Please use the following appsettings to retrieve valud of `ValidationContext.MemberName` property:
12+
13+
```xml
14+
<configuration>
15+
<appSettings>
16+
...
17+
<add key="aspnet:GetValidationMemberName" value="true"/>
18+
...
19+
</appSettings>
20+
</configuration>
21+
```
22+
23+
### Affected APIs
24+
`System.ComponentModel.DataAnnotations.ValidationContext.MemberName`
25+
26+
### Category
27+
ASP.NET
28+
29+
<!--
30+
### 563497 <ASP.NET WebForms> ValidationContext.MemberName is NULL with custom DataAnnotations.ValidationAttribute
31+
32+
-->
33+
34+

0 commit comments

Comments
 (0)