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
[System.Reflection.DefaultMember(nameof(Caption))]publicclassLoosingProperties{publicstringCaption{get;set;}publicvoidS(){varx=newLoosingProperties();x.Caption="Hello";// works differently for equivalent VB.NET classvary=newClassWithReflectionDefaultMember();// from C#y="World";// <----- notice `.Caption` is missing here}}
Expected output
[System.Reflection.DefaultMember(nameof(Caption))]publicclassLoosingProperties{publicstringCaption{get;set;}publicvoidS(){varx=newLoosingProperties();x.Caption="Hello";vary=newClassWithReflectionDefaultMember();// from C#y.Caption="World";}}
VB.Net input code
We need a C# project with a class like this:
Then in VB.NET, access its DefaultMember:
Erroneous output
Expected output
Details
The text was updated successfully, but these errors were encountered: