Microsoft KB Archive/813575

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

Article ID: 813575

Article Last Modified on 5/10/2007

-

APPLIES TO


 * Microsoft .NET Compact Framework

-





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.



SYMPTOMS
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?



CAUSE
This problem occurs because there is a file sharing violation. By default, application files are saved in the My Device\Program Files\  folder in Smart Device Emulator. 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\  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.



WORKAROUND
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.



STATUS
This behavior is by design.



Steps to Reproduce the Behavior
 Open Microsoft Visual Studio .NET 2003. On the File menu, point to New, and then click Project. Under Project Types, select Visual Basic Projects. Under Templates select Smart Device Application, and then click OK. 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. Drag a Button from Toolbox onto Form1.  Double-click Button1, and then add the following code to the Button1_Click event: MsgBox(&quot;Hello&quot;) </li> On the Debug menu, click Start.</li> In the Deploy dialog box, select Pocket PC 2002 Emulator (Default), and then click Deploy. Wait until the Application appears in Emulator.</li> Click Button1, and then click OK on the message box (MsgBox).</li> Close the Pocket PC 2002 Emulator. In the Shut Down dialog box, select Save Emulator state, and then click OK.</li> On Debug menu, click Start.

The error message listed in the &quot;Symptoms&quot; section appears.</li></ol>

<div class="references_section">