Ticket T470328
Visible to All Users
Duplicate

Snap - Debuging in Visual Studio - Function evaluation time out

created 8 years ago

Hi,

Oleg wrote in one of my previous posts:
"I would also like to note that it is not recommended to analyze the GetText method results in the VS Watch window. In most cases, you will get the "Function evaluation time out" result.
The most suitable approach in such cases is to store the GetText method result in a string variable and check this variable value in the Watch window. Please take a look at the attached video. "

Is there ANY workaround to this problem? I work in a huge project where adding variable, recompiling the project and then restarting it takes a lot of time so it is not a solution for day to day use.

I am asking because I am facing this problem very often.

Additionally the similar problem occurs when i want to "expand" the snap control object in the Visual Studio (hover over the object and then click the "+" for the object, then drill down to the object in the base object and expand them using "+", and then…").

There is also some other problem when there is a message like "waiting for UI thread to finish blocking …" (something like this) which also occurs while working with Snap.

Thank you.

Comments (1)
MK MK
Marcin Krupa 1 8 years ago

    BTW What is the root cause of those issues? Is there some multi threading issue? Can this be resolved by using BeginInvoke(), DoEvents(), BeginUpdate() or other not-trivial methods?

    Answers approved by DevExpress Support

    created 8 years ago (modified 8 years ago)

    Hello Marcin,
    Allow me to describe the root cause of this behavior.
    There are three major elements in our RichEditControl's (SnapControl) internal structure:
    Document Model - logical representation of a document structure (sections, paragraphs, tables, etc.)
    Document Formatter - a component to calculate a document layout based on its logical representation
    Document Layout - visual representation of a document structure (pages, columns, rows, etc.)

    On an attempt to execute the Document.GetText method, we perform the following actions:

    1. Send a command to the Document Formatter to stop current calculation.
    2. Wait until the Document Formatter handles this command.
    3. Obtain a corresponding document text.
      4. Send a command to the Document Formatter to continue the calculation.

    When you execute the GetText method in VS Debugger, all current operations are paused (in particular, the Document Formatter is temporarily stopped).
    Correspondingly, the 2nd step ("waiting until the Document Formatter handles the command") will not be executed, because the Document Formatter is paused.
    Unfortunately, in the current RichEditControl (SnapControl) architecture, we can't prevent the Document Formatter from being stopped on obtaining a document's text.

    That is why, we can't suggest any other solution to analyze the GetText method result (or other control properties whose values also depend on Document Formatter calculation) in VS Debugger, except for using additional local variables, adding a breakpoint after calculating this variable value, and checking this value in the VS Watch window.

      Show previous comments (3)
      DevExpress Support Team 8 years ago

        Hi Marcin,
        For version 15.2, we can suggest you trying the approach with accessing our internal (private) API using .NET Reflection mechanism.
        I have attached a sample project to demonstrate this approach in action.
        I hope you will find this sample helpful.

        MK MK
        Marcin Krupa 1 8 years ago

          Thank you Oleg. I will try to use it and will let you know how it works.

          DevExpress Support Team 8 years ago

            You are welcome, Marcin!

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.