Microsoft KB Archive/945371

= Exception error message when you use Visual Studio 2008 to deploy a SQL Client-based application to a mobile device or to an emulator: &quot;Missing method Exception&quot; =

Article ID: 945371

Article Last Modified on 12/12/2007

-

APPLIES TO


 * Microsoft Visual Studio 2008 Professional Edition
 * Microsoft Visual Studio 2008 Academic Edition
 * Microsoft Visual Studio 2008 Standard Edition
 * Microsoft Visual Studio 2008 Team Edition for Database Professionals
 * Microsoft Visual Studio 2008 Team Edition for Software Architects
 * Microsoft Visual Studio 2008 Team Edition for Software Developers
 * Microsoft Visual Studio 2008 Team Edition for Software Testers
 * Microsoft Visual Studio 2008 Team Suite

-



SYMPTOMS
Consider the following scenario.
 * You install Microsoft Visual Studio 2005.
 * You install Visual Studio 2008 side by side with Visual Studio 2005.
 * You uninstall Microsoft SQL Server Compact 3.5 Design Tools
 * In Visual Studio 2008, you try to deploy a SQL Client-based application to a mobile device or to an emulator.

In this scenario, the application is not deployed to the mobile device or the emulator. Additionally, you receive an exception error message that resembles the following when you start the application on the mobile device or on the emulator.

Missing method Exception

{&quot;Can't find PInvoke DLL 'dbnetlib.dll'.&quot;}



CAUSE
This problem occurs because Visual Studio 2008 is installed side by side with Visual Studio 2005. In the side-by-side installation of Visual Studio 2008, the SQL Client CAB files that are used for installing SQL Clients on mobile devices point to the SQL Client CAB files of Visual Studio 2005.

Notes  The following location of the SQL Client CAB files is incorrect:

%Program Files%\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0

 The following location of the SQL Client CAB files is correct:

%Program Files%\Microsoft SQL Server Compact Edition\v3.5\Devices\Client





RESOLUTION
To resolve this problem, reinstall SQL Server Compact 3.5 Design Tools. To do this, run the following file on the Visual Studio 2008 installation DVD or CD:

VSTS\WCU\SSCE\SSCEVSTools- .msi

Note  represents the language of Visual Studio 2008.



Steps to reproduce the behavior
 Install Visual Studio 2005. During the installation, enable the Smart Device Programmability option. Install Visual Studio 2005 Service Pack 1 (SP1). Install the following products:  SQL Server 2005 Compact Edition</li> SQL Server 2005 Compact Edition Tools for Visual Studio 2005 Service Pack 1</li> Microsoft ActiveSync 4.5</li></ul> </li> In Visual Studio 2008, create a new Smart Device project.</li> In the Add Reference dialog box, add a reference to the System.Data.SQLClient.dll file.

Note This DLL is located in the following folder:

%Program Files%\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Client\v2.0

</li> Uninstall the SQL Server Compact 3.5 Design Tools that are installed with Visual Studio 2005.</li> In Visual Studio 2008, deploy the application to an emulator or to a mobile device.

Notice that the SQL Client for mobile devices is not installed. Additionally, you receive the exception error message that is mentioned in the &quot;Symptoms&quot; section.</li></ol>

Keywords: kbexpertiseadvanced kbtshoot kbprb KB945371

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.