Discussion VS2008: How to stop SQLCE Cab from deploying on every debug session

  • Friday, September 25, 2009 4:43 PM
     
     
    In a VS2008 smart device project that utilizes SQLCE, the SQLCE cabs deploy on every debug session from the IDE. This is very time consuming.  SQLCE is installed on the device.  How do I stop this?

All Replies

  • Tuesday, September 29, 2009 8:09 AM
    Moderator
     
     
    Did you use an emulator or an actual device?

    If you use an emulator, you can save the state when exiting the emulator. So next time Visual Studio launches the emulator, SQL CE is persistent and doesn't need to be installed again. 

    If you are using a device, the reason might be that the version of SQL CE installed on the device is an older version. Please make sure the correct version of SQL CE is installed the first time you deploy the project. See these lines in the output window of Visual Studio:

    ------ Deploy started: Project: SdProj, Configuration: Debug Any CPU ------
    Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.ppc.wce5.armv4i.CAB'
    Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.repl.ppc.wce5.armv4i.CAB'
    Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.dev.enu.ppc.wce5.armv4i.CAB'
    Deploying 'C:\Program Files\Windows Mobile 6 SDK\Managed Libraries\Microsoft.WindowsMobile.Telephony.dll'
    Deploying 'D:\Samples\sd\TabTest\SdProj\bin\Debug\db1.sdf'
    Deploying 'D:\Samples\sd\TabTest\SdProj\bin\Debug\SdProj.exe'
    ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
    ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========


    Please mark the post that helps you, and unmark that does not. This benefits our community members.
  • Tuesday, September 29, 2009 8:24 AM
     
     
    If you are using VS 2008 SP1, make sure to download and install the SQL Compact SP1 Windows Mobile components: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=fce9abbf-f807-45d6-a457-ab5615001c8f
    http://erikej.blogspot.com Erik Ejlskov Jensen - Please mark as answer, if this was it.
  • Tuesday, September 29, 2009 7:54 PM
     
     
    It looks like an older version is being deployed.

    The below references are set in the project:

    System.Data.SqlClient
    C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\Client\System.Data.SqlClient.dll

    System.Data.SqlServerCe
    C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\System.Data.SqlServerCe.dll

    Why would it still be deploying the older version of SQLCE?
    NOTE: This is a WM5 device, not WM6.  Does this make a difference?
  • Tuesday, September 29, 2009 10:45 PM
     
     
    Well now that was fun.  I attempted to reference all the latest System.Data/SQLCE/SQLClient, etc. and spent the entire afternoon trying to figure why I kept getting the error:

    "The operation completed successfully"
    Error Source = SQL Server Compact ADO.NET Data Provider

    When attempting a simple SELECT from a table utilizing the SQLCEDataReader.

    I reverted back to the old version of the System.Data dlls and now it is working again.  HUGE waste of time.
  • Friday, January 01, 2010 6:26 PM
     
     

     

     

    I use VS 2008 SP1 with SQL Compact SP1.
    It always deploys...

    Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.ppc.wce5.armv4i.CAB'
    Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.repl.ppc.wce5.armv4i.CAB'
    Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.dev.enu.ppc.wce5.armv4i.CAB'
     

    My solution:
    Create a small cab file with a small content.
    Raplace the files above with your small CAB by renaming your copies properly.
    Deploying 3 small cabs take only 12 seconds.

  • Tuesday, January 31, 2012 4:32 PM
     
     
    If you are using VS 2008 SP1, make sure to download and install the SQL Compact SP1 Windows Mobile components: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=fce9abbf-f807-45d6-a457-ab5615001c8f
    http://erikej.blogspot.com Erik Ejlskov Jensen - Please mark as answer, if this was it.

    This is the latest version however.

    http://www.microsoft.com/download/en/details.aspx?id=8831

     

    From what I have seen, when you first deploy on the emulator it deployes the latest version of Compact you have installed on Program Files. Then if you have referenced a SqlServerCe.Dll in the project that is in in the loca directory and is older than your installation in program files, then VS will continue to deploy the version that goes with your DLL.

    Solution: Make sure the reference to your SQLCE.dll is to the windows program files directory, hence to the latest version (as per the link above)


    • Edited by kuklei Tuesday, January 31, 2012 11:03 PM
    •  
  • Tuesday, January 31, 2012 11:04 PM
     
     
    indeed strange...if the reference is to the DLL in program files than I found out it solves the problem. Make sure you are not referencing a DLL in your local directory.

  • Tuesday, May 22, 2012 9:42 AM
     
     

    I have solved this problem on following way:

    My project's reference to the "System.Data.SqlServerCe" library WAS to the dll at project's folder. I have been copied the dll from it's origin folder (which is C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\System.Data.SqlServerCe.dll) to my project's folder.

    Then, in the VS2008 project, I've removed that reference, and made reference to the System.Data.SqlServerCe library - but to the dll placed at it's origin folder: C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\. Also set option "Copy Local" to False.

    When I started project (deployed on device) there are no more deploying mentioned three dll's. And application on device started few times faster.