[Bug] `ToPropertyUnsafe` (and Possibly Other Unsafe Methods) Always Fails
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从src/ReactiveUI.Binding.Shared/Fallback/RuntimePropertyRaiser.cs开始,重点查看引用的第152–157行以及第108–114行的异常路径。检查runtime如何跨各自的assembly解析IReactiveObject和IReactiveObjectExtensions,然后使用ReactiveUI 26.0.1通过Avalonia MVVM示例复现问题。在该复现中ToPropertyUnsafe运行时不抛出异常,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- C#
- 星标
- 9
- 派生
- 2
- 平均合并
- 6 小时 48 分钟
- 30 天内合并 PR
- 71
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
reactiveui/ReactiveUI.Binding.SourceGenerators 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 68/100
reactiveui/ReactiveUI.Binding.SourceGenerators#175 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 32/100
reactiveui/ReactiveUI.Binding.SourceGenerators#170 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 30/100
reactiveui/ReactiveUI.Binding.SourceGenerators#3 ·
维护者通常 1 天内回复
查看 reactiveui/ReactiveUI.Binding.SourceGenerators 的全部 Issue
相似的 Issue
-
needs-area-label
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
Fallout-build/Fallout#708 ·
维护者通常 5 天内回复
-
bug next version
难度 2/5 1-3 小时 新手友好度 68/100
Rem0o/FanControl.Releases#4220 · 1 条评论 ·
-
area:repo audit:approved audit:auto priority:P3
难度 2/5 1-3 小时 新手友好度 66/100
elsa-workflows/elsa-core#8771 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nkdAgility/azure-devops-migration-tools#3217 ·
维护者通常 1 天内回复