Share via

how to fix System.TypeInitializationException : Инициализатор типа "FlaUI.Core.Tools.SystemInfo" выдал исключение. ----> System.InvalidOperationException : Не удается загрузить данные имени счетчика, поскольку в реестре обнаружен недопустимый индекс "

_cnehle 0 Reputation points
2024-02-25T19:29:17.4566667+00:00

In university we started to work with Windows Forms и WPF. For each work we're given a pre-work with all files and tests. But when I try to start test, they fall with the same Exception: System.TypeInitializationException : Инициализатор типа "FlaUI.Core.Tools.SystemInfo" выдал исключение. ----> System.InvalidOperationException : Не удается загрузить данные имени счетчика, поскольку в реестре обнаружен недопустимый индекс "". Maybe someone can help me with it? My prof said he don't know what is this....

Developer technologies | Windows Forms
Developer technologies | Windows Presentation Foundation
Developer technologies | Visual Studio | Testing
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Hui Liu-MSFT 48,711 Reputation points Microsoft External Staff
    2024-02-26T03:14:01.2+00:00

    Hi,@_cnehle. Welcome to Microsoft Q&A. The exception you're encountering is related to the FlaUI library. This exception occurs when the library attempts to access performance counter data from the Windows registry but encounters an invalid index.

    Here are some steps you could try to resolve or diagnose the issue:

    Check Registry Permissions: Ensure that the account running the tests has the necessary permissions to read from the registry. You may need to adjust registry permissions to allow access.

    Update FlaUI Library: Make sure you are using the latest version of the FlaUI library. Updates to the library may include fixes for known issues, including issues related to performance counters.

    Disable Performance Counters: If performance counters are not essential for your testing, you can try disabling them. This can be done by setting the UsePerformanceCounters property of the AutomationBase class to false before initializing FlaUI.

    Check System Environment: Ensure that your system environment is set up correctly. Sometimes, issues with environment variables or system configurations can lead to unexpected behavior.

    If none of the above solutions work, you may need to consult the documentation or seek assistance from the maintainers of the third-party library FlaUI for further troubleshooting and support.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.