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

Article translations Article translations
Article ID: 945371 - View products that this article applies to.
Expand all | Collapse all

On This Page

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
{"Can't find PInvoke DLL 'dbnetlib.dll'."}

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-Language.msi
Note Language represents the language of Visual Studio 2008.

MORE INFORMATION

Steps to reproduce the behavior

  1. Install Visual Studio 2005. During the installation, enable the Smart Device Programmability option.
  2. Install Visual Studio 2005 Service Pack 1 (SP1).
  3. Install the following products:
    • SQL Server 2005 Compact Edition
    • SQL Server 2005 Compact Edition Tools for Visual Studio 2005 Service Pack 1
    • Microsoft ActiveSync 4.5
  4. In Visual Studio 2008, create a new Smart Device project.
  5. 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
  6. Uninstall the SQL Server Compact 3.5 Design Tools that are installed with Visual Studio 2005.
  7. 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 "Symptoms" section.

Properties

Article ID: 945371 - Last Review: December 12, 2007 - Revision: 1.2
APPLIES TO
  • Microsoft Visual Studio 2008 Professional Edition
  • Microsoft Visual Studio 2008 Academic Edition
  • Microsoft Visual Studio 2008 Standard Edition
  • Microsoft Visual Studio Team System 2008 Database Edition
  • Microsoft Visual Studio Team System 2008 Architecture Edition
  • Microsoft Visual Studio Team System 2008 Development Edition
  • Microsoft Visual Studio Team System 2008 Test Edition
  • Microsoft Visual Studio Team System 2008 Team Suite
Keywords: 
kbexpertiseadvanced kbtshoot kbprb KB945371

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com