Applications developed for the desktop are installed like any other Microsoft Windows application. You can deploy Windows-based applications from Visual Studio by using either of the following technologies: ClickOnce or Windows Installer. For more information about deploying applications from Visual Studio, see the Visual Studio 2010 documentation. Your application can be built to use either central or private deployment for SQL Server Compact 3.5; for more information, see Private Deployment vs. Central Deployment (SQL Server Compact). For more information about building a desktop application that uses SQL Server Compact 3.5, see Building Applications for Desktops (SQL Server Compact).

Visual Studio 2010 is the preferred environment for developing applications for the desktop with SQL Server Compact 3.5 SP2. For more information, see Installing a Development Environment.

Starting with SQL Server Compact 3.5 Service Pack 2, the 64-bit SQL Server Compact Runtime MSI has been integrated into ClickOnce deployment. If a user installs an application built with SQL Server Compact 3.5 SP2 on a 64-bit computer by using ClickOnce technology, and SQL Server Compact 3.5 SP2 was selected as an installation prerequisite by the publisher, then both the 32-bit SQL Server Compact Runtime and the 64-bit SQL Server Compact Runtime are installed. In previous versions of SQL Server Compact 3.5, only the 32-bit SQL Server Compact Runtime was installed.

Final Application Deployment for Applications that use Central Deployment for SQL Server Compact

If you use ClickOnce technology to deploy your application, you can configure ClickOnce to centrally deploy Microsoft SQL Server Compact 3.5 to the target computer as a prerequisite when your application is installed. You can do this from the Publish tab of the Project Designer in Visual Studio. 

To Configure SQL Server Compact as a Prerequisite for ClickOnce Deployment

  1. To open the Project Designer, in Solution Explorer, double-click My Project if you are working on a Visual Basic project; or right-click the project and select Properties if you are working on a C# project.

  2. Click Prerequisites to open the Prerequisites dialog box.

  3. Select the check box for SQL Server Compact 3.5 SP2 from the list of prerequisites. If your application uses either the ADO.NET data provider (System.Data.SqlServerCe.dll) or the Entity Framework data provider (System.Data.SqlServerCe.Entity.dll), .NET Framework 2.0 or a later version must be present on the target computer. If your application uses either of the data providers, make sure that the checkbox for the version of .NET Framework suitable for your application is also selected.

    The Create setup program to install prerequisite components check box must be selected to configure prerequisites.

  4. Under Specify the install location for prerequisites, select the appropriate option for your publishing scenario.

  5. Click OK.

If SQL Server Compact 3.5 is not installed as a prerequisite during deployment, you must install it on the target computer by running the SQL Server Compact 3.5 installer for desktop computers (SSCERuntime-ENU.msi). Installing SQL Server Compact 3.5 by running the installer registers the native DLLs and puts the managed assemblies in the Global Assembly Cache (GAC). This makes sure that the installation of the SQL Server Compact 3.5 on the computer can be serviced by Microsoft Update.

The installer contains the following libraries:

  • SQLCESE35.DLL

  • SQLCEQP35.DLL

  • SQLCEME35.DLL

  • SQLCEOLEDB35.DLL (OLEDB data provider)

  • SQLCECA35.DLL

  • SQLCECOMPACT35.DLL

  • SQLCEER35xx.DLL

  • System.Data.SqlServerCe.dll (ADO.NET data provider)

  • System.Data.SqlServerCe.Entity.dll (Entity Framework data provider)

Final Application Deployment for Applications that use Private Deployment for SQL Server Compact

When you create the installer for an application that uses private deployment for SQL Server Compact 3.5, it must contain the binaries for SQL Server Compact 3.5 in addition to the binaries for your application.

To privately deploy SQL Server Compact 3.5 with your application, the installer must, at a minimum, contain the following SQL Server Compact 3.5 assemblies and native libraries:

  • The ADO.NET data provider (System.Data.SqlServerCe.dll). For private deployment, this file is in the following directory: %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Private. (If your application uses the Entity Framework, System.Data.SqlServerCe.Entity.dll should be included from the same directory.)

  • The following native libraries: sqlceme35.dll, sqlceqp35.dll, sqlcese35.dll, and sqlceer35xx.dll. The native libraries are in the following directory: %Program Files%\Microsoft SQL Server Compact Edition\v3.5.

If you are using ClickOnce to publish your application, make sure that SQL Server Compact 3.5 is not selected as a prerequisite. If SQL Server Compact 3.5 is selected as a prerequisite, the installer will perform a central deployment of SQL Server Compact 3.5 when your application is installed. In this case, your application will use the centrally installed instance of SQL Server Compact 3.5, rather than the SQL Server Compact 3.5 assemblies deployed in its application path.

Concepts

Installing and Deploying on a Desktop (SQL Server Compact)

Private Deployment vs. Central Deployment (SQL Server Compact)

Building Applications for Desktops (SQL Server Compact)