TargetInvocationException

6 posts, 0 answers
  1. James Atherton
    James Atherton avatar
    4 posts
    Member since:
    Sep 2009

    Posted 03 Sep 2009 Link to this post

    I am currently running Telerik WinControls 2009 Q2, I have a ribbon on an MDI form inheriting from the ShapeForm form class.

    I would click run, it comes up without a hitch, sometimes it will be fine, most times however if I move the mouse, hover over a button, do nothing, it will throw a TargetInvocationException.  This exception is pasted below.  This application worked flawlessly till I added the RibbonControl to update the GUI.

    Any suggestions on fixing this issue would be greatly appreciated.  I am at a loss as to what might be going on but the common denominator seems to be the ribbon   The inner exception is a null reference exception in Telerik.WinControls but I am at a loss what this might be.

     

     

    Exception:

    System.Reflection.TargetInvocationException was unhandled

      Message="Exception has been thrown by the target of an invocation."

      Source="mscorlib"

      StackTrace:

           at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

           at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

           at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

           at System.Delegate.DynamicInvokeImpl(Object[] args)

           at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)

           at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)

           at System.Threading.ExecutionContext.runTryCode(Object userData)

           at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)

           at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

           at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)

           at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

           at System.Windows.Forms.Control.WndProc(Message& m)

           at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

           at Telerik.WinControls.RadControl.WndProc(Message& m)

           at Telerik.WinControls.UI.RadRibbonBar.WndProc(Message& m)

           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

           at System.Windows.Forms.Application.Run(ApplicationContext context)

           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

           at SoftwareConfigurator.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

      InnerException: System.NullReferenceException

           Message="Object reference not set to an instance of an object."

           Source="Telerik.WinControls"

           StackTrace:

                at Telerik.WinControls.Layouts.ContextLayoutManager.LayoutQueue.GetTopMost()

                at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()

                at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)

           InnerException:

  2. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 04 Sep 2009 Link to this post

    Hi James,

    Thanks for writing and for reporting this issue. We are going to take a look at it but I would still like to receive some more details on the inner exception in particular. These details might be helpful to exactly determine the reason for the undesired behavior. Thanks for your time. I look forward to receiving the requested details.

    Regards,
    Deyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. James Atherton
    James Atherton avatar
    4 posts
    Member since:
    Sep 2009

    Posted 04 Sep 2009 Link to this post

    InnerException: {"Object reference not set to an instance of an object."}
    Source: "Telerik.WinControls"
    StackTrace:    at Telerik.WinControls.Layouts.ContextLayoutManager.LayoutQueue.GetTopMost()
       at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
       at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)
    TargetSite: {Telerik.WinControls.RadElement GetTopMost()}

    If there is any additional information I might be able to provide relating to this error let me know.
  5. Deyan
    Admin
    Deyan avatar
    2038 posts

    Posted 09 Sep 2009 Link to this post

    Hello James,

    Thanks for the details.

    However, we are still not able to reproduce this issue. I would also like to mention that the RadRibbonBar control is generally meant to be used in TopLevel forms due to its UI concept: to expose the functionality of an application in one place. It is supposed to replace the old-fashioned menus and toolbars, which are also TopLevel application controls.

    We are going to further investigate the null-reference exception though and hopefully we will fix it for our next major release.

    Thanks for pointing this issue to us.

     
    Sincerely yours,
    Deyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Marcello
    Marcello avatar
    8 posts
    Member since:
    Dec 2008

    Posted 13 Jan Link to this post

    Hello, 

    we have the same problem on 2015Q1 but we don't have a RibbonControl but a RadGridView

     System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.WinControls.Layouts.ContextLayoutManager.LayoutQueue.GetTopMost()
       at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()

    Have you some suggestion on how to prevent this error?

     

    Kind regards

    Marcello

     

  7. Dimitar
    Admin
    Dimitar avatar
    1408 posts

    Posted 15 Jan Link to this post

    Hi Marcello, 

    Thank you for writing.

    The provided information is not sufficient for us to determine why this exception occurs. This is why I would recommend you to submit a support ticket for this. Please include as much information as possible so that our technical team can take a deep dive into the issue and come up with a solution for you.

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready