Saved-State Files

You can save the state of the Device Emulator at any time by clicking Save State on the emulator File menu. You are also prompted to save state whenever you close the emulator. When you select the Save State option, the emulator creates a file that has the extension, .dess (Device Emulator Saved State). This file contains not only the operating system image but also the memory state, configurations, shared folders and so on. In other words, a .dess file represents the complete state of the emulator at the time that it simulates a suspend-to-RAM operation. The user-specific saved-state files are located by default at drive:\Documents and Settings\username\Application Data\Microsoft\Device Emulator. Global saved-state files are located under drive:\Documents and Settings\All Users\Application Data\Microsoft\Device Emulator.

Note

By default, saved-state images are created on a per-user basis. To create a global saved-state image, start the emulator from the command line by using the /g switch. For more information, see Device Emulator Command-Line Reference. If the underlying operating system image has changed, perhaps from an update, device emulator will prompt you to either cold restart from the operating system image or load the saved-state image. This prompt signifies that the operating system image has changed, since the saved state image was last booted.

Because the .dess extension is registered at setup time, double-clicking a .dess file starts the Device Emulator with the state saved in that file. Visual Studio supports one .dess file for each device emulator.

Security noteSecurity Note:

Using saved-state files from untrusted sources can pose a security risk.

Saved-state files versus Operating System Image files

An image file is a copy of the operating system that is copied to flash memory on a device. By default, image files are located at drive:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\Emulators\Images, and they have the .bin extension. The emulator takes longer to start from an image file than from a .dess file because the emulator must emulate all the operating system's cold-boot code with an image file. Conversely, the .dess file contains all the state data that a battery would sustain when a device is asleep. As a result, to resume operation the emulator just restores the .dess file to emulated RAM and peripherals and then resumes where it left off. For this reason, Visual Studio includes default .dess files for some emulators. These files are stored at drive:\Documents and Settings\All Users\Application Data\Microsoft\Device Emulator\. Default .dess files represent the state of the device immediately after it is cold-booted. Emulators that have a default .dess file load it instead of the image file when the emulator is started with the default settings.

State-saving options in the user interface are as follows:

Prompt

Action

Close without saving

Closes the Device Emulator without saving state.

This is the default setting.

Save

Saves the current state to the current Virtual Machine Identifier (VMID) of the emulator.

In Visual Studio, this option is disabled if the datastore has set the protected flag for this VMID.

See Also

Tasks

How to: Start the Device Emulator

How to: Start the Device Emulator Manager

How to: Restore an Emulator OS Image

Other Resources

Device Emulator