PRB: Selecting “Save Emulator State” During Smart Devices Emulator Shutdown Can Cause Visual Studio .NET to Not Deploy Application to Emulator

This article has been archived. It is offered "as is" and will no longer be updated.
Beta Information
This article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about how to obtain support for a Beta release, see the documentation that is included with the Beta product files, or check the Web location from which you downloaded the release.
If you select Save Emulator state when you shut down Microsoft Pocket PC 2002 Emulator before the debugger stops and then you try to deploy the same application again, you may receive the following error message and Visual Studio .NET does not deploy the application to Pocket PC 2002 Emulator:
There were deployment errors. Continue?
This problem occurs because there is a file sharing violation. By default, application files are saved in the My Device\Program Files\ApplicationName folder in Smart Device Emulator. ApplicationName is the same name as your smart device project. When you select Save Emulator state during shut down, Emulator retains the files under My Device\Prgram Files\ApplicationName folder. When you try to deploy the application again immediately after shut down, Visual Studio .NET does not deploy the application because of the filesharing violation.
To work around this problem, use one of the following methods:
  • In the Shut Down dialog box, select Turn off Emulator, and then click OK.
  • Use Soft Reset on the Emulator menu.
  • Stop the application, and then Save Emulator State. To stop the application, use one of the following methods:
    • Close the application by using Running Programs screen of the Emulator.
    • On the Debug menu of Visual Studio .NET 2003, click Stop Debugging.
This behavior is by design.
More information

Steps to Reproduce the Behavior

  1. Open Microsoft Visual Studio .NET 2003. On the File menu, point to New, and then click Project.
  2. Under Project Types, select Visual Basic Projects. Under Templates select Smart Device Application, and then click OK.
  3. In the Smart Device Application Wizard, select Pocket PC as the platform, select Windows Application as the project type, and then click OK. By default, Form1.vb is created.
  4. Drag a Button from Toolbox onto Form1.
  5. Double-click Button1, and then add the following code to the Button1_Click event:
  6. On the Debug menu, click Start.
  7. In the Deploy dialog box, select Pocket PC 2002 Emulator (Default), and then click Deploy. Wait until the Application appears in Emulator.
  8. Click Button1, and then click OK on the message box (MsgBox).
  9. Close the Pocket PC 2002 Emulator. In the Shut Down dialog box, select Save Emulator state, and then click OK.
  10. On Debug menu, click Start.

    The error message listed in the "Symptoms" section appears.
For more information, visit the following Microsoft Web site:
Using the Emulator in Smart Device Projects

Article ID: 813575 - Last Review: 10/26/2013 11:58:00 - Revision: 3.0

Microsoft .NET Compact Framework

  • kbnosurvey kbarchive kbdevicespecific kbemulation kberrmsg kbdeployment kbdebug kbprb KB813575