Profiling Silverlight applications

You can use ANTS Performance Profiler to profile Silverlight 4 and 5 applications.

Line-level timings are not available when profiling Silverlight applications, and some performance counters are not shown on the timeline.

You cannot profile Silverlight applications from the command line in Windows 8.

You cannot profile Silverlight applications running in a browser in 64-bit Windows XP.

To profile Silverlight applications that run in a web browser, you must have Internet Explorer installed on your computer. This type of Silverlight profiling is not available in other browsers.

Introducing Silverlight applications

Microsoft Silverlight applications can run either in a web browser, or in an Out-Of-Browser mode, depending on the setting chosen at compile time.

Silverlight applications that run in a web browser are contained in an HTML or ASPX file which may be stored:

  • in the local file system
  • on an HTTP server on the local computer
  • on an HTTP server on a remote computer

Before profiling Silverlight applications, close all instances of Internet Explorer currently running on your computer. This ensures ANTS Performance Profiler connects to the correct instance of iexplore.exe when you start profiling.

Setting up for Silverlight applications running in a web browser

To profile Silverlight browser applications running in a web browser, on the settings screen, perform the following steps:

  1. From the list of application types, click Silverlight 4+ application.
  2. In Silverlight application specify either the local file path (prefixed by file:///) to the HTML file that embeds the Silverlight application, or the URL of the HTML or ASPX file that embeds the application.
    Note that the URL must be a server running on the same computer as the computer where ANTS Performance Profiler is installed.
  3. Select the required Profiling modeChart performance counters,  Additional profiler options, and the browser to launch the application.
    For more information, see Working with application settings and Setting up chart performance counters.

  4. Click 

Internet Explorer launches, and the Silverlight application is shown.

During a profiling session you can interact normally with your application and with the profiler. For more information, see The timeline.

When you have finished interacting with your web application, click the  button in ANTS Performance Profiler to stop profiling.

Closing your browser window does not cause profiling to stop.

Setting up for Silverlight applications running in Out-Of-Browser mode

You can't profile Silverlight applications running in Out-Of-Browser mode on computers with security fix MS15-049 installed. For more information, see Silverlight out-of-browser profiling causes ANTS Performance & Memory Profilers to crash.

 

To profile Silverlight 4 or 5 browser applications running in Out-Of-Browser mode, on the settings screen, perform the following steps:

  1. Click Silverlight 4+ application from the list of application types.
  2. In Silverlight application specify the local file path (prefixed by file:///) to the XAP file.
    This is normally found in %LOCALAPPDATA%\Microsoft\Silverlight\OutOfBrowser\.
  3. Select the required Profiling modeChart performance counters,  Additional profiler options, and the browser to launch the application.
    For more information, see Working with application settings and Setting up chart performance counters.
    Note that line-level timings are not available for Silverlight applications.
  4. Click .

The Microsoft Silverlight Out-Of-Browser launcher starts, and the Silverlight application is shown.

During a profiling session you can interact normally with your application and with the profiler.

When you have finished interacting with your web application, click the  button in ANTS Performance Profiler to stop profiling.

Troubleshooting

If you experience problems profiling your Silverlight application:

  • Ensure that the Silverlight application is compiled against Silverlight 4 or 5. Older versions of Silverlight may appear to work but will give inaccurate results.
  • Check that the Silverlight application runs correctly on the computer which you are profiling it on, without the profiler attached.
  • Note that you may need to run ANTS Performance Profiler as an Administrator for some types of Silverlight application and computer configuration.

Didn't find what you were looking for?