I'm on Rx 2.0.21114, using .NET 4 (Windows Forms app)
System.InvalidOperationException: Disposable has already been assigned.
at System.Reactive.Disposables.SingleAssignmentDisposable.set_Disposable(IDisposable value)
at System.Reactive.Concurrency.CurrentThreadScheduler.Trampoline.Run(SchedulerQueue`1 queue)
at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func`3 action)
at System.Reactive.Concurrency.LocalScheduler.Schedule[TState](TState state, Func`3 action)
at System.Reactive.Producer`1.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
at System.Reactive.Concurrency.AsyncLock.Wait(Action action)
at System.Reactive.Linq.Observ?ble.Buffer`2._.CloseBuffer(IDisposable closingSubscription)
at System.Reactive.Concurrency.Scheduler.Invoke(IScheduler scheduler, Action action)
at System.Reactive.Concurrency.DefaultScheduler.<>c__DisplayClass4`1.<Schedule>b__3(Object _)
at System.Reactive.Concurrency.ConcurrencyAbstractionLayerImpl.Timer.Tick(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading._TimerCallback.PerformTimerCallback(Object state)
The reason I can't just use the TimeSpan, IScheduler overload is because the TimeSpan can
change at runtime. This application was running fine for 4 hours when this happened randomly. The application has been running with this code for some time without this issue. I can't reproduce at will.
If anyone has any ideas as to what could cause this, or next steps to take, I would appreciate it.