New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting a ref return value using PropertyInfo #24520
Comments
Perhaps related? Bring back Though I assume is a current issue for serializing to and from |
Currently it looks like is definately going to Ref returns themselves are an issue with boxing; however... I think it makes sense that And/Or... like public partial class PropertyInfo
{
public virtual object GetValueDirect(TypedReference obj)
public virtual void SetValueDirect(TypedReference obj, object value)
} |
cc @atsushikan @KrzysztofCwalina @ahsonkhan |
There is a difference between getting a ref return by value and by ref, right? (I haven't used ref returns in anger yet so I'm not completely familiar with it) e.g.
I would expect |
This is a subset of https://github.com/dotnet/corefx/issues/15960 (15960 covers all existing Invoke methods, not just |
Sorry to trouble you folks, but is this working in some form in .NET now? |
The code above throws this exception from PropertyInfo.GetValue:
System.NotSupportedException: 'ByRef return value not supported in reflection invocation.'
Can you use a PropertyInfo to get the value of a ref return property?
[EDIT] Add C# syntax highlight by @karelz
The text was updated successfully, but these errors were encountered: