[Bug]: Ambiguity between ReactiveUI.Primitives and System.Reactive extension methods

Open
#154 11 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start by reproducing the reported call with ReactiveUI.Primitives and System.Reactive in scope, then inspect SubscribeExtensions and ObservableExtensions to identify the overlapping signatures. Confirm the chosen resolution with the issue discussion and verify that the SaveCommand.ThrownExceptions.Subscribe example compiles without an ambiguity error.

Written by the indexing model from the issue text.

Description

Prerequisites
  • I have searched open and closed issues for duplicates.
  • I am using the latest stable release.
Describe the bug 🐞

Recreating this because I think there really might be an issue. Because ObservableExtensions is in System this clash will be triggered by "normal" use of global usings for System and ReactiveUI.Primitives.

I'm working on adoption of ReactiveUI 24, and have turned up this error, I think due to referencing both ReactiveUI 24 and DynamicData (which is pulling in System.Reactive):

The call is ambiguous between the following methods or properties: 'ReactiveUI.Primitives.SubscribeExtensions.extension<System.Exception>(System.IObservable<System.Exception>).Subscribe(System.Action<System.Exception>)' and 'System.ObservableExtensions.Subscribe(System.IObservable, System.Action)'

I can work around this by explicitly calling SubscribeExtensions.Subscribe(), however any thoughts on how best at deal with this?

Steps to reproduce

Code along the lines of:
this.SaveCommand.ThrownExceptions.Subscribe(e => activity.AddItem(e.ToString()));

With:
Both ReactiveUI 24 and System.Reactive referenced
Both SubscribeExtensions and ObservableExtensions are in scope

Reproduction repository

No response

Expected behavior

No ambiguity.

Screenshots 🖼️

No response

IDE

Visual Studio 2026

.NET version

.NET 10

Target framework(s)

net10.0

Operating system

Windows

OS version

No response

Device

No response

ReactiveUI version

21.1.0

Additional information ℹ️

ReactiveUI.Primitives 7.1.1

Dominant language
C#
Stars
16
Forks
4
Avg merge
3h 38m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reactiveui/Primitives

All issues in reactiveui/Primitives

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.