TextPatternRange.GetText() UIAutomation throws AccessViolationException on Windows 11

Varun Kumar 0 Reputation points Microsoft Employee
2023-02-01T08:47:43.0066667+00:00

TextPatternRange.GetText() method throws AccessViolationException on Windows 11

TextPatternRange is giving problem in Win 11 and working absolutely fine in Win10.

Even we have updated our Win 11 to

Edition Windows 11 Enterprise

Version 22H2

Installed on ‎17-‎02-‎2023

OS build 22621.1265

Experience Windows Feature Experience Pack 1000.22638.1000.0

UIAutomationClient.dll version : 4.8.9037.0

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
319 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
7,577 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 43,971 Reputation points
    2023-02-02T09:15:27.7333333+00:00

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.

    The issue with the "TextPatternRange.GetText()" UIAutomation method throwing an "AccessViolationException" on Windows 11 may be due to compatibility issues between the automation library you are using and the new operating system.

    Here are a few steps you can try to resolve the issue:

    1. Update the Automation Library: Check if an updated version of the automation library you are using is available that is compatible with Windows 11 and install it.
    2. Use a Different Automation Library: If an updated version of the current automation library is not available or the issue persists after updating, consider switching to a different automation library that is compatible with Windows 11.
    3. Check for Windows 11 Compatibility: Check if the automation library you are using is compatible with Windows 11. If not, the vendor or developer may need to release a compatibility update.

    It's also recommended to keep your operating system and software up to date to ensure compatibility and security.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments

  2. Limitless Technology 43,971 Reputation points
    2023-02-02T09:15:37.64+00:00

    Double post

    0 comments No comments