XAML Spy Service

XAML app connectivity and discovery is provided by the XAML Spy Service. The XAML Spy Service is a Windows service that automatically starts when the OS has booted. The XAML Spy Service hosts a socket server where each XAML app client must connect to in order to be visible in the XAML Spy explorer.

The socket client logic is implemented in a client library, a version exists for each supported platform. The libraries are distributed via NuGet, as a dependency of the XamlSpy package. By referencing the NuGet package, a connection will be created with the XAML Spy Service when the app is started. For more details on how this works, see XAML Spy for Android, iOS or Windows.

Configuring the XAML Spy Service

The XAML Spy Service is configured in the XAML Spy settings (settings > xaml spy service). The status of the windows service can be reviewed and the service can be restarted. The socket server address and port number can be changed. By default the XAML Spy Service listens to any IP address and uses port 4530.

The following screenshot show the service settings page of the standalone XAML Spy app.

The configuration options for XAML Spy in Visual Studio are available in the Visual Studio options dialog (in Visual Studio navigate to Tools > Options > XAML Spy) as shown below.

The preferred public address is configurable when the machine running the XAML Spy Service has multiple public-facing IP addresses. The preferred public address is used by apps that require a public IP address, such as apps running on a phone device, or in Android and iOS emulators.

Restarting and changing the configuration of the XAML Spy service requires elevated permissions. The OS will display a message box requesting these permissions when hitting the apply changes button.

Platform connectivity requirements

Certain environments require a non-localhost IP address. When spying an app on a physical remote device for example, you cannot use localhost as server address. Whenever the XAML Spy service settings result in limitations, it will be shown in the Platform Connectivity section on the XAML Spy service settings page.

Any platform connectivity issue that may occur is listed at the bottom of the xaml spy service settings page, as is demonstrated in the following image.