3

According to this question, using ReactiveUI and CM should be a walk in the park: ReactiveUI and Caliburn Micro together? however I am having difficulties at the baby steps already.

I am going with my usual setup:

ShellViewModel + ShellView and different forms of ContentViewModel + ContentView and a simple MEF Bootstrapper.

I am also using Fody to weave the PropertyChanged and PropertyChanging for ReactiveUI, but I get the error without Fody, too.

[Export]
public class ShellViewModel : ReactiveObject
{
    public ShellViewModel()
    {
        ActiveItem = new ContentViewModel();
    }
    public ContentViewModel ActiveItem { get; set; }
}

and its XAML:

<Window x:Class="UiTest.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ShellView" Height="300" Width="300">
    <ContentControl x:Name="ActiveItem"></ContentPresenter>
</Window>

The other two files are an empty class and usercontrol.

On application start I am greeted by a StackOverflowException in ReactiveUI.Core, which means I must be doing something fundamentally wrong. I would love for some kind of up to date documentation, if anyone has some, by the way.

Update

I only get the error when I am using RxUI 5.x, not when using RxUI 4.x. I have ruled out MEF being obnoxious: if instead of the ShellViewModel I make the ContentViewModel a ReactiveObject, it will still give us a nice stack overflow. This happens on ctor, by the way. Caliburn doesn't touch anything yet, so I guess I should change the topic title.

Stack trace:

System.Reactive.Core.dll!System.Reactive.ObserverBase<System.Exception>.ObserverBase() + 0x23 bytes 
    System.Reactive.Core.dll!System.Reactive.AnonymousObserver<System.Exception>.AnonymousObserver(System.Action<System.Exception> onNext, System.Action<System.Exception> onError, System.Action onCompleted) + 0x38 bytes 
    System.Reactive.Core.dll!System.Reactive.AnonymousObserver<System.Exception>.AnonymousObserver(System.Action<System.Exception> onNext) + 0x4c bytes 
    System.Reactive.Core.dll!System.Reactive.Observer.Create<System.Exception>(System.Action<System.Exception> onNext) + 0xd4 bytes 
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xb9 bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes

... about 100.000 lines later:

ReactiveUI.dll!ReactiveUI.RxApp.Initialize() + 0xcd bytes   
ReactiveUI.dll!ReactiveUI.RxApp.DependencyResolver.get() + 0x7c bytes   
The maximum number of stack frames supported by Visual Studio has been exceeded.    
Community
  • 1
  • 1
Manuel Schweigert
  • 4,884
  • 4
  • 20
  • 32
  • Can you please upload your sample project to [4shared](http://www.4shared.com) and i will take a look into this ? – Ibrahim Najjar Aug 09 '13 at 22:09
  • There are easier upload-portals than 4shared, that took a while... http://www.4shared.com/zip/xSHTyKGn/UiTest.html have a look. – Manuel Schweigert Aug 09 '13 at 22:45
  • I chose 4shared because some guys upload to websites that make it impossible to download files easily. Anyway i will take a look to see if i can help out. – Ibrahim Najjar Aug 09 '13 at 22:53
  • Ahh damn ! I have vs 2010 and i can't open your solution. – Ibrahim Najjar Aug 09 '13 at 22:54
  • You could just use the files and import the nuget packages yourself; Caliburn.Micro and ReactiveUI. – Manuel Schweigert Aug 09 '13 at 22:58
  • I know but the problem is that i am using a 3G data-plan and downloading costs. Nevertheless i will try to do so. – Ibrahim Najjar Aug 09 '13 at 23:00
  • I am pretty sorry but I have .NET 4 on Windows XP and i can't download any more files. Reactive UI only works on .NET 4.5. I really wanted to help but i couldn't. Anyway, while trying to download the packages through Nuget i found a two libraries that integrate ReactiveUI with Caliburn.Micro, [look here](https://www.nuget.org/packages?q=caliburn.micro+reactiveui). #PaulBetts might be able to help since he wrote ReactiveUI, try to reach him. – Ibrahim Najjar Aug 09 '13 at 23:30
  • I tried both and by doing so found that I only get the error in RxUI 5.x and not in 4.x, which works as expected, both compiled to .net 4.5 though. – Manuel Schweigert Aug 10 '13 at 00:16
  • All this text and not one stack trace – Ana Betts Aug 10 '13 at 00:48

1 Answers1

0

This is a bug in the current version of ReactiveUI that I'll fix momentarily. Thanks for the report.

Update: This is fixed, grab 5.1.2 from the gallery.

Ana Betts
  • 73,868
  • 16
  • 141
  • 209