System invalidoperationexception system windows documents run не является visual или visual3d

I works in ver. 3.1.3
3.2.0 and 4.0 produces this error: ‘System.Windows.Documents.Run’ is not a Visual or Visual3D
It looks very similar to this issue here: #234

<DataTemplate x:Key="DateTemplateLinks" x:Name="DateTemplateLinks">
                <StackPanel Orientation="Vertical">
                    <TextBlock FontSize="11" Visibility="{Binding Website, Converter={StaticResource VisText}}">
                          <Hyperlink NavigateUri="{Binding Website, TargetNullValue=about:blank}" RequestNavigate="Hyperlink_open">Website</Hyperlink>
                    </TextBlock>
                </StackPanel>
            </DataTemplate>
System.InvalidOperationException
  HResult=0x80131509
  Nachricht = "System.Windows.Documents.Run" ist kein "Visual" oder "Visual3D".
  Quelle = PresentationCore
  Stapelüberwachung:
   bei MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
   bei MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
   bei System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
   => bei MaterialDesignThemes.Wpf.Extensions.<GetVisualAncestry>d__3.MoveNext() in D:\a\1\s\MaterialDesignThemes.Wpf\Extensions.cs: Zeile61 (LINE 61)
   bei System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
   bei System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   bei MaterialDesignThemes.Wpf.DataGridAssist.AllowDirectEditWithoutFocus(Object sender, MouseButtonEventArgs mouseArgs) in D:\a\1\s\MaterialDesignThemes.Wpf\DataGridAssist.cs: Zeile268
   bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   bei System.Windows.UIElement.OnPreviewMouseDownThunk(Object sender, MouseButtonEventArgs e)
   bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
   bei System.Windows.Input.InputManager.ProcessStagingArea()
   bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   bei System.Windows.Application.RunDispatcher(Object ignore)
   bei System.Windows.Application.RunInternal(Window window)
   bei System.Windows.Application.Run(Window window)
   bei System.Windows.Application.Run()
   bei VSRepoGUI.App.Main()

Server Version : 1.3.0.96

Studio Version : 1.3.0.96

Email Address : kunwarsurya007@gmail.com

Steps to follow : I have a procedure with single in and out parameters, when I tried testing into the designer, I got the exception. MySQL database activity could not identify out perameter of the stored procedure.

at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)

at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)

at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)

at Dev2.Studio.Views.Workflow.WorkflowDesignerView.WorkflowDesignerViewPreviewMouseDown(Object sender, MouseButtonEventArgs e)

at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)

at System.Windows.Input.InputManager.ProcessStagingArea()

at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)

at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

09.04.2018, 13:47. Показов 842. Ответов 0

Доброго времени суток

Создал форму на c# для работы с базой данных, пробую переносить данные из формы в Excel

Суть заключается в следующем: Раньше при попытках выполнить перенос никаких ошибок не возникало, а сейчас visual studio ссылается на данное исключение: System.Runtime.InteropServices.COMExcept ion: «Исключение из HRESULT: 0x800A03EC»

И ссылается на строку с Датой рождения, но если удалить эту строку все данные спокойно будут переносится в таблицу excel и всё будет работать, а если вернуть — исключение.

Visual Studio ссылается на данный файл ActivityLog.xml где записана причина возникновения ошибки:

System.InvalidOperationException: «System.Windows.Documents.FlowDocume nt» не является Visual или Visual3D. в MS.Internal.Media.VisualTreeUtils.AsVisu al(DependencyObject element, Visual& visual, Visual3D& visual3D) в MS.Internal.Media.VisualTreeUtils.AsNonN ullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D) в System.Windows.Media.VisualTreeHelper.Ge tParent(DependencyObject reference) в Microsoft.VisualStudio.Language.Intellis ense.Implementation.GoToDefMouseHandler. IsMouseOverTextView(Point position) в Microsoft.VisualStudio.Language.Intellis ense.Implementation.GoToDefMouseHandler. <<OnModifierKeyStateChanged>b__19_0>d.Mo veNext() — Конец трассировка стека из предыдущего расположения, где возникло исключение — в System.Runtime.CompilerServices.TaskAwai ter.ThrowForNonSuccess(Task task) в System.Runtime.CompilerServices.TaskAwai ter.HandleNonSuccessAndDebuggerNotificat ion(Task task) в Microsoft.VisualStudio.Text.Utilities.Gu ardedOperations.<CallExtensionPointAsync >d__29.MoveNext() — Конец трассировка стека из предыдущего расположения, где возникло исключение — в Microsoft.VisualStudio.Telemetry.Windows ErrorReporting.WatsonReport.GetClrWatson ExceptionInfo(Exception exceptionObject)

Помогите пожалуйста разобраться с этим

The exception is «‘System.Windows.Documents.Run’ is not a Visual or Visual3D.»

I get this on a particular occasion, I cannot easily reproduce it.

Anyway, it seems that you let a DependencyObject go through System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)

but the doc of getparent specifies that «The value of reference can represent either a Visual or Visual3D object.»

Maybe you should wrap this call with a try catch or check if the object is a visual or a visual3d before calling the method.

Here’s the stacktrace

Quote:

at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)

at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)

at ActiproSoftware.Windows.Media.VisualTreeHelperExtended.GetAncestor(DependencyObject source, Type desiredType)

at ActiproSoftware.Windows.Media.VisualTreeHelperExtended.GetCurrentOrAncestor(DependencyObject source, Type desiredType)

at ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.a(Point A_0)

at ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.OnPreviewMouseMove(MouseEventArgs e)

at System.Windows.UIElement.OnPreviewMouseMoveThunk(Object sender, MouseEventArgs e)

at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

at System.Windows.ContentElement.RaiseEventImpl(RoutedEventArgs args)

at System.Windows.ContentElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

at System.Windows.Input.InputManager.ProcessStagingArea()

at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)

at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)

at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)

at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

at System.Windows.Window.ShowHelper(Object booleanBox)

at System.Windows.Window.Show()

at System.Windows.Window.ShowDialog()

    Comments (3)

    Thanks Simon, I’ve updated all the code that calls VisualTreeHelper.GetParent so that it now checks for a Visual/Visual3D source object first. This change will be in the next maintenance release.

    Will this be released in a future version of Ribbon (for WPF) 1.0.x Maintenance Release?

    We can’t use the version 3 (some problem with the status bar not showing that I don’t have time to investigate right now), so for now but we are stuck with this bug and it’s a crash we can’t recover properly..

    Hi Simon,

    Send us an email and we can either work to get you an updated v1.0 maintenance release or help you get updated to v3.0.


    The latest build of this product (v24.1.5) was released 2 months ago,
    which was after the last post in this thread.

    Add Comment

    Please log in to a validated account to post comments.

    Simply clicking on an unstaged file (either untracked or modified but unstaged) results in a crash. The following exception is logged in sourcetree.log.

    2014-08-22T14:11:10: Fatal error: 
    System.InvalidOperationException: 'System.Windows.Documents.Run' is not a Visual or Visual3D.
    
    2014-08-22T14:11:10: Stack trace: 
       at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
       at SourceTree.Utils.GeneralHelper.GetVisualParent[T](Object childObject)
       at SourceTree.View.Utils.DataGridBehaviour.OnGridRightClick(Object sender, MouseButtonEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    

    Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии
  1. Мало памяти на диске с что делать windows 10
  2. Где хранятся обои для рабочего стола windows 10
  3. Amd radeon hd 7290 graphics драйвер windows 10
  4. Мемтест про для windows 10 64
  5. Средство проверки памяти windows 10 зависает