Error Opening Window with RichTextBox

4 posts, 0 answers
  1. Rui Silva
    Rui Silva avatar
    16 posts
    Member since:
    Dec 2009

    Posted 21 Sep Link to this post

    Hello. 

    I am having a strange problema and i already tried everything i remember.

    When I am in Debug everything works Fine.

    But when i am in Release mode i am getting always this error, whenever i try to Open a Window with RadRichTextBox.

    I Have Absolute no code associated. Only a RadRichTextBox in a Grid.

    Please help!!

    Error code:

    System.NullReferenceException: A referência de objecto não foi definida como uma instância de um objecto.
       em Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.UpdateCaretStyle()
       em Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.MeasureOverride(Size availableSize)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       em System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Control.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       em System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       em System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       em System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Border.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Control.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       em System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       em System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       em System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       em System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Border.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Control.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
       em System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
       em System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
       em System.Windows.Controls.Grid.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
       em System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Controls.Border.MeasureOverride(Size constraint)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.Window.MeasureOverrideHelper(Size constraint)
       em System.Windows.Window.MeasureOverride(Size availableSize)
       em System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       em System.Windows.UIElement.Measure(Size availableSize)
       em System.Windows.ContextLayoutManager.UpdateLayout()
       em System.Windows.UIElement.UpdateLayout()
       em System.Windows.Interop.HwndSource.SetLayoutSize()
       em System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
       em System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
       em System.Windows.Forms.Integration.ElementHost.<OnHandleCreated>b__54_0()
       em System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
       em System.Windows.Threading.Dispatcher.Invoke(Action callback)
       em System.Windows.Forms.Integration.ElementHost.OnHandleCreated(EventArgs e)
       em System.Windows.Forms.Control.WmCreate(Message& m)
       em System.Windows.Forms.Control.WndProc(Message& m)
       em System.Windows.Forms.Integration.ElementHost.WndProc(Message& m)
       em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       em System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  2. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    137 posts

    Posted 21 Sep Link to this post

    Hello Rui,

    I am not able to replicate the issue. I have attached a simple application where the MainWindow has a button that will open a second window containing a RichTextBox.  Please run the app on your side and verify that it works as expected (wait a couple seconds for the window to open after clicking the button).

    Make sure your Telerik DLL references have CopyLocal=True as you may be missing DLLs in the bin/Release folder.

    If you're confirmed that your project's configuration matches my attached demo, please update the demo so that it replicates the issue and send it back to us for further investigation.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Rui Silva
    Rui Silva avatar
    16 posts
    Member since:
    Dec 2009

    Posted 26 Sep Link to this post

    Thanks for your help. This was a tricky problem to solve.

    The problem was having .Design.dll in my Bin folder, even not having it referenced in my project. Somehow the Telerik dll tries to load those .Design.dll Libraries and it throws that error.

    It was a tricky one but gladly solved it.

     

  5. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    137 posts

    Posted 26 Sep Link to this post

    Hello Rui,

    I'm happy to hear you're up and running! Yes, the .Design DLLs shouldn't be in the bin output. I've forwarded this to the team for an internal investigation consideration.

    I'll mark this ticket as resolved, but if you have further trouble with it you can reopen it. I also notice that you submitted this as a Forum post, you can also choose to submit it as a Support Ticket which has a much faster turnaround time (24 hrs as opposed to 72 hrs).

    Thank you for contacting Support and for choosing Telerik by Progress.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top