SilkTest WPF recognition failure after upgrading .Net Framework.

SilkTest WPF recognition failure after upgrading .Net Framework.

SilkTest no longer recognizes WPF controls, after the application under test was updated to use a newer version of the .Net Framework,

If you encounter this issue after upgrading a WPF application; the recognitions problem may relate to the lack of .Net native images on the affected machine. This can happen after upgrading the application under test, installing a new version of the .Net Framework; or after applying a Windows Update on the system.

Creating the .Net native images is quite an intensive CPU operation, as explained in the following wiki article:

http://community.microfocus.com/borland/test/silk_test/b/weblog/archive/2015/10/28/wpf-recognition-failing-after-installing-windows-updates-on-w10.aspx

How to confirm if you are affected by this problem:

The following screenshot shows the WPF sample application running without native images. Note that the PresentationFramework.ni.dll is not loaded into the AUT process, only the PresentationFramework.dll is present. In this scenario SilkTest's WPF support does not work.

The following screenshot shows the WPF sample application running with the PresentationFramework.ni.dll loaded into its process; in this case SilkTest's WPF support should work fine:

How to create the native images on Windows

1. Locate ngen.exe. On my Windows 7 use the .NET framework folder with the highest version number. eg:

> C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe

2. Launch a command prompt(under Admin Rights) and navigate into the directory above.

3. Run the “ngen.exe update” command.

* Note that ngen.exe may show some errors in the output, but these can be safely ignored.

4. Reboot the machine: Note that it can take some time for the system to apply the native images; so WPF recognition may not be recovered immediately. If this is the case shut down the application and wait for one hour, before trying it again. As soon as the native images are updated and loaded, SilkTest' WPF support should work correctly.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2016-11-16 16:12
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.