Share via


Profile Visual C++, Visual C#, and Visual Basic code in Windows Store apps on a remote device

This topic describes how to profile code in Windows Store apps that are written in XAML and Visual C++, Visual C#, or Visual Basic and when you want to collect data on a remote device.

Visual Studio is usually installed on a desktop computer. Windows Store apps run on a wide variety of devices, form factors, and processor types. Remote profiling lets you collect performance data on any device that is connected to your Visual Studio computer over a network or that is connected directly through an Ethernet cable. When you profile remotely, Visual Studio deploys the latest build of your app. You can start your app immediately, or you can profile your app after it is started by a contract or some other process.

Note

  1. To profile on a remote device, you must be an administrator on the device.

  2. We recommend that you perform user interaction directly on the remote device and that you do not use Remote Desktop Connection. Remote Desktop Connection can significantly alter the performance of your app and the performance data that you collect.

    1. To collect the most accurate performance results, you should profile a Release build of your app. See How to: Set Debug and Release Configurations in the MSDN Library.

Contents

Configure remote profiling on the remote device

Configure remote profiling in Visual Studio

  • To profile a managed app

  • To profile a Visual C++ app

Profile the app

Profile a running or installed app

Analyze the profiling results

Configure remote profiling on the remote device

You must have a developer license installed on the remote device; you must have the Visual Studio Remote Tools installed on the remote device; and the Remote Debugging Monitor must be running on the remote device.

  • To install a developer license installed on the remote device, see Gettting a developers license

  • To install the Visual Studio remote tools, see Installing the Remote Debugger

  • To start the remote debugging Monitor, choose Remote Debugging Monitor on the Start screen.

Configure remote profiling in Visual Studio

To profile an app on a remote device, you specify the name or IP address of the device in the debugging properties of your Visual Studio project.

To profile your app on a remote device:

  1. In Visual Studio, open the project that you want to profile.

  2. To collect the most accurate performance results, you should profile a Release build of your app. Select Release from the Solutions Configurations list on the Visual Studio toolbar.

    For more information, see How to: Set Debug and Release Configurations in the MSDN Library.

The following procedures depend on whether your project is written in Visual C++ or managed code (Visual C#, Visual Basic, etc.).

To profile a managed app

  1. On the Debug menu, choose Project Properties.

  2. Choose the Debug menu item.

    Managed project properties for remote debugging

  3. From the Target Device list, choose Remote Machine.

  4. In the Remote Machine box, type the name or IP address of the remote device.

    If the remote device is on the same subnet as the Visual Studio computer, or if the device is directly connected to the Visual Studio computer, you can choose Find, and then select the device on the Remote Debugger connections dialog box.

Require Authentication should always be set to Yes. Not requiring network authentication puts your network at significant risk of attacks by malicious users.

These properties are ignored by the profiler:

  • Do not launch, but debug my code when it starts

  • Allow Local Network Loopback

  • Uninstall and then re-install my package. All information about the package state is deleted.

  • Debugger Type

To profile a Visual C++ app

  1. On the Debug menu, choose Project Properties.

  2. Choose Debugging in the Configuration Properties node.

    C++ project properties for remote debugging

  3. From the Debugger to launch list, choose Remote Machine.

  4. In the Machine Name row, type the name or IP address of the remote device.

    If the remote device is on the same subnet as the Visual Studio computer, or if the device is directly connected to the Visual Studio computer, you can choose the down arrow in the row, choose the <Locate...> item, and then select the device on the Remote Debugger connections dialog box.

Require Authentication should always be set to Yes. Not requiring network authentication puts your network at significant risk of attacks by malicious users.

These properties are ignored by the profiler:

  • Launch Application

  • Allow Local Network Loopback

  • Debugger Type

  • Deploy Visual C++ Debug Runtime Libraries

Profile the app

To profile the current Visual Studio solution or project:

  1. Choose Performance and Diagnostics on the Debug menu, (keyboard: ALT + F2.

  2. Choose CPU Sampling and then choose Start.

  3. Exercise the app. Run those parts of the application that you want to profile. Repeat key scenarios to get more accurate results.

  4. Stop profiling. In the Performance and Diagnostic document window, choose Stop collection (keyboard: CTRL + ALT + F2).

    Stop Profiling

Profile a running or installed app

You can also collect profiling data for native or managed code for an app that is already running on the remote device, or for an app that has been installed from the Windows Store:

  1. Choose Performance and Diagnostics on the Debug menu, (keyboard: ALT + F2.

  2. From the Analysis Targets list choose Change Target and then choose Running App or Installed App.

    Change Target list

  3. From the Select Running App or the Select Installed App Package dialog box, choose the app that you want to profile.

    Select Running App dialog box

  4. Choose CPU Sampling and then choose Start.

  5. Exercise the app. Run those parts of the application that you want to profile. Repeat key scenarios to get more accurate results.

  6. Stop profiling. In the Performance and Diagnostic document window, choose Stop collection (keyboard: CTRL + ALT + F2).

Analyze the profiling results

When you stop the profiling run, the profiler analyzes the data and displays the Summary view of the profiling data in a document window of the IDE. See Analyze performance data for Visual C++, Visual C#, and Visual Basic code in Windows Store apps.

See Also

Concepts

Analyze the performance of Windows Store apps using Visual Studio diagnostic tools

Profile Visual C++, Visual C#, and Visual Basic code in Windows Store apps on a local machine

Analyze performance data for Visual C++, Visual C#, and Visual Basic code in Windows Store apps