Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoutedViewHost causes designer error in VisualStudio 2012 #209

Closed
swsnr opened this issue Mar 14, 2013 · 4 comments
Closed

RoutedViewHost causes designer error in VisualStudio 2012 #209

swsnr opened this issue Mar 14, 2013 · 4 comments
Labels

Comments

@swsnr
Copy link

swsnr commented Mar 14, 2013

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
Copy link
Contributor

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

@anaisbetts
Copy link
Member

@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

anaisbetts pushed a commit that referenced this issue Mar 20, 2013
wendazhou added a commit to wendazhou/ReactiveUI that referenced this issue Mar 21, 2013
# 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 reactiveui#209
@DamianReeves
Copy link

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

@anaisbetts
Copy link
Member

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

@lock lock bot added the outdated label Jun 26, 2019
@lock lock bot locked and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants