SQL Server CE 4 Clickonce deploy VS2013

According to MS, SQL Server CE is being deprecated, but for now, I really can't think about migrating to SQL Server Express or LocalDB , so, on VS 2013, there is a exclamation with a text "Prerequisite could not be found for bootstrapping". Is there a way to workaround? When my program is deployed, SQL Server CE need to be installed automatically.

Thanks in advance


I had got the same problem. SQL Server Compact Edition 4.0 was not existed in my VS 2013 Prerequisite list in publish section of my project. To solve the same problem I've used next steps:

  • Download install files for Microsoft® SQL Server® Compact 4.0 SP1
  • Go to C:Program Files (x86)Microsoft SDKsWindowsv8.1ABootstrapperPackages
  • Create SQL Server Compact Edition 4.0 folder in current location
  • Copy downloaded install files to created folder
  • Create product.xml file in created folder and copy next code in this file
  • product.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="System.Data.SqlServerCe.4.0">
    <InstallChecks>
        <FileCheck Property="IsInstalled" 
            FileName="System.Data.SqlServerCe.dll" SearchPath="C:Program FilesMicrosoft SQL Server Compact Editionv4.0Desktop" />
      </InstallChecks>
    
      <PackageFiles CopyAllPackageFiles="false">
        <PackageFile
          Name="SSCERuntime_x86-ENU.exe"
          HomeSite="sqllocaldb_32" />
        <PackageFile
          Name="SSCERuntime_x64-ENU.exe"
          HomeSite="sqllocaldb_64" />
      </PackageFiles>
    
     <Commands Reboot="Defer">
        <Command PackageFile="SSCERuntime_x86-ENU.exe" Arguments="">
          <InstallConditions>      
            <FailIf Property="AdminUser" Compare="ValueEqualTo" Value="false" String="AdminRequired" />
            <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="Intel" />
            <BypassIf Property="IsInstalled" Compare="ValueExists" Value="0" />
          </InstallConditions>
          <ExitCodes>
            <ExitCode Value="0" Result="Success" />  
            <ExitCode Value="1641" Result="SuccessReboot" />
            <ExitCode Value="3010" Result="SuccessReboot" />      
            <DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
          </ExitCodes>
        </Command>
        <Command PackageFile="SSCERuntime_x64-ENU.exe" Arguments="" >
          <InstallConditions>
            <BypassIf Property="ProcessorArchitecture" Compare="ValueNotEqualTo" Value="amd64" />
            <BypassIf Property="IsInstalled" Compare="ValueExists" Value="0" />
          </InstallConditions>
          <ExitCodes>
            <ExitCode Value="0" Result="Success" />
            <ExitCode Value="1641" Result="SuccessReboot" />
            <ExitCode Value="3010" Result="SuccessReboot" />
            <DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
          </ExitCodes>
        </Command>
      </Commands>
    </Product>
    
  • Create en folder in created folder

  • In en folder create package.xml file and copy next code in this file:

  • package.xml:

    <?xml version="1.0" encoding="utf-8" ?>
    <Package
      xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
      Name="DisplayName"
      Culture="Culture">
    
        <!-- Defines a localizable string table for error messages-->
        <Strings>
            <String Name="DisplayName">SQL Server Compact Edition 4.0</String>
            <String Name="Culture">en</String>
            <String Name="AdminRequired">Administrator permissions are required to install SQL Server Compact Edition 4.0. Contact your administrator.</String>
            <String Name="GeneralFailure">A failure occurred attempting to install SQL Server Compact Edition 4.0.</String>
        </Strings>
    </Package>
    
  • Restart MS Visual Studio

  • And you can find SQL Server Compact Edition 4.0 in Prerequisite


  • If for one reason or another you can't (directly) apply the fix of Erik, then you can try the following workaround:

  • Get a hold on the SQL Server Compact Edition 4.0 bootstrap package , you might find it somewhere on your disk or you could get it from a colleague
  • Install that package in the C:Program Files (x86)Microsoft SDKsWindowsv8.1ABootstrapperPackages folder, as this folder is used by VS2013 to look for bootstrap packages
  • Restart VS and the prerequisite warning should be gone

  • 您可以简单地将SQLCE dll文件包含在您的应用程序中,我有几篇关于如何执行此操作的博客文章

    链接地址: http://www.djcxy.com/p/96672.html

    上一篇: 在Visual Studio 2013中管理sdf数据

    下一篇: SQL Server CE 4 Clickonce部署VS2013