Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

RoutedViewHost causes designer error in VisualStudio 2012 #209

Closed
lunaryorn opened this Issue · 4 comments

4 participants

@lunaryorn

The following MainWindow.xaml causes a "System.Remote.Remoting.RemotingException" when viewed in the designer of VisualStudio 2012:

<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:routing="clr-namespace:ReactiveUI.Routing;assembly=ReactiveUI.Routing_Net45"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <routing:RoutedViewHost x:Name="ViewHost" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </Grid>
</Window>
@jordansjones

This is related to commit 4d71c9d

Here is a stack trace:

Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects
   at ReactiveUI.RxApp.<>c__DisplayClass9.<.cctor>b__2() in y:\HomeDirectoryStorage\SkyDrive\ReactiveUI_External\ReactiveUI\RxApp.cs:line 80
   at System.Reactive.Concurrency.Scheduler.Invoke(IScheduler scheduler, Action action)
   at System.Reactive.Concurrency.ScheduledItem`2.InvokeCore()
   at System.Reactive.Concurrency.EventLoopScheduler.Run()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
Exception has been thrown by the target of an invocation.
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   at ReactiveUI.Reflection.<>c__DisplayClass29.<.cctor>b__1e(Object y) in y:\HomeDirectoryStorage\SkyDrive\ReactiveUI_External\ReactiveUI\Reflection.cs:line 66
   at ReactiveUI.Reflection.TryGetValueForPropertyChain[TValue](TValue& changeValue, Object current, String[] propNames) in y:\HomeDirectoryStorage\SkyDrive\ReactiveUI_External\ReactiveUI\Reflection.cs:line 247
   at ReactiveUI.ObservedChangedMixin.TryGetValue[TSender,TValue](IObservedChange`2 This, TValue& changeValue) in y:\HomeDirectoryStorage\SkyDrive\ReactiveUI_External\ReactiveUI\ObservedChangedMixin.cs:line 45
   at ReactiveUI.ObservedChangedMixin.fillInValue[TSender,TValue](IObservedChange`2 This) in y:\HomeDirectoryStorage\SkyDrive\ReactiveUI_External\ReactiveUI\ObservedChangedMixin.cs:line 54
   at ReactiveUI.ReactiveNotifyPropertyChangedMixin.<nestedObservedChanges>b__1(IObservedChange`2 x) in y:\HomeDirectoryStorage\SkyDrive\ReactiveUI_External\ReactiveUI\ReactiveNotifyPropertyChangedMixin.cs:line 139
   at System.Reactive.Linq.Observαble.Select`2._.OnNext(TSource value)

Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
The calling thread cannot access this object because a different thread owns it.
   at System.Windows.Threading.Dispatcher.VerifyAccess()
   at System.Windows.DependencyObject.GetValue(DependencyProperty dp)
   at ReactiveUI.Routing.RoutedViewHost.get_Router() in y:\HomeDirectoryStorage\SkyDrive\ReactiveUI_External\ReactiveUI.Routing\RoutedViewHost.cs:line 33
@paulcbetts
Owner

@jordansjones Good work tracking this down. Can you submit a PR to fix it? I would just disable the WhenAny or exit early in design mode, there should be a method on RxApp to tell you whether you're in Design Mode or not

@jordansjones jordansjones referenced this issue from a commit in jordansjones/ReactiveUI
@jordansjones jordansjones Resolves issue #209
Exit early in RoutedViewHost when in Design Mode.
Added "XDESPROC.EXE" (VS2012 Design Mode) to RxApp list of design
environments.
Also fixed an issue in RxApp where checking for design mode was testing
against full path of assembly instead of just the assembly name.
9833374
@wendazhou wendazhou referenced this issue from a commit in wendazhou/ReactiveUI
@wendazhou wendazhou Merge branch 'master' of git://github.com/reactiveui/ReactiveUI
# By Markus Olsson (3) and Jordan S. Jones (1)
# Via Markus Olsson (1) and Paul Betts (1)
* 'master' of git://github.com/reactiveui/ReactiveUI:
  Add OrderedComparer files in platform projects
  Type inferred starting point for anonymous types
  OrderedComparer - simple comparer chaining
  Resolves issue #209
fabf444
@DamianReeves

Any plan on putting this out in a fix for ReactiveUI 4.5?

@paulcbetts
Owner

@DamianReeves This got merged into master, it should show up in the next 4.x release soon

@paulcbetts paulcbetts closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.