CallerMemberName in .NET 4.0 not working

后端 未结 3 2099
悲哀的现实
悲哀的现实 2021-02-05 06:17

I am trying to use CallerMemberName attribute in .NET 4.0 via BCL portability pack. It is always returning an empty string instead of the member name. What am I doi

3条回答
  •  星月不相逢
    2021-02-05 06:38

    I found the solution, though it's not useful to me. You need to install KB2468871 on top of .NET Framework 4 to be able to use caller info attributes. Unfortunately, I can't ask each developer to remember to install it when they setup development environment.

提交回复
热议问题