[Bug] `ToPropertyUnsafe` (and Possibly Other Unsafe Methods) Always Fails
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
Research direction
Start in src/ReactiveUI.Binding.Shared/Fallback/RuntimePropertyRaiser.cs, especially the referenced lines 152–157 and the exception path at 108–114. Check how the runtime resolves IReactiveObject and IReactiveObjectExtensions across their assemblies, then reproduce with the Avalonia MVVM example using ReactiveUI 26.0.1. Done means ToPropertyUnsafe runs without throwing in that reproduction.
Written by the indexing model from the issue text.
Description
Prerequisites
- I have searched this repository's open and closed issues for duplicates.
- I am using the latest stable release.
What happens
ToPropertyUnsafe always fails, because this code is wrong:
IReactiveObject is defined in the ReactiveUI.Core assembly, while IReactiveObjectExtensions is defined the ReactiveUI assembly, so the code above always fails, and ToPropertyUnsafe ends up throwing this exception:
What you expected instead
No exception thrown.
Minimal reproduction
In a fresh Avalonia MVVM app with ReactiveUI, add the following lines to the MainViewModel:
private readonly ObservableAsPropertyHelper<string> _valueOaph;
public MainViewModel()
{
_valueOaph = Observable.Return("").ToPropertyUnsafe(this, x => x.Value)
}
public string Value => _valueOaph.Value;
Steps to reproduce
- Create an Avalonia MVVM app with Reactive UI:
dotnet new avalonia.mvvm -m ReactiveUI - Add the lines mentioned in Minimal Reproduction
dotnet run
Exception and stack trace
Package and version
ReactiveUI 26.0.1
UI framework
Avalonia
Operating system
Windows
Target framework
net10.0
Device and OS version
No response
IDE
No response
Did this work in an earlier version?
No response
Workaround
No response
Additional information
No response
- Dominant language
- C#
- Stars
- 9
- Forks
- 2
- Avg merge
- 6h 48m
- Merged PRs (30d)
- 71
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reactiveui/ReactiveUI.Binding.SourceGenerators
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
reactiveui/ReactiveUI.Binding.SourceGenerators#175 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 32/100
reactiveui/ReactiveUI.Binding.SourceGenerators#170 ·
Maintainers usually reply within 1 day
-
Dependency DashboardOpen
Difficulty 1/5 Under an hour Newbie friendliness 30/100
reactiveui/ReactiveUI.Binding.SourceGenerators#3 ·
Maintainers usually reply within 1 day
All issues in reactiveui/ReactiveUI.Binding.SourceGenerators
Similar issues
-
needs-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Fallout-build/Fallout#708 ·
Maintainers usually reply within 5 days
-
bug next version
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Rem0o/FanControl.Releases#4220 · 1 comment ·
-
area:repo audit:approved audit:auto priority:P3
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
elsa-workflows/elsa-core#8771 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nkdAgility/azure-devops-migration-tools#3217 ·
Maintainers usually reply within 1 day