Could not load file or assembly 'System.Data.SqlServerCe'...

I am trying to use SQL Mobile 2005 with Visual Studio 2005.  I have a simple sql mobile db i created and am trying to test connectivity to the DB in a simple app.  I added the reference to the SqlServerCE and the verison # that is shown in properties is 3.0.3600.0, but when i look at the physical DLL in explorer (found at C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0) the version # is 3.0.5206.0, so when i compile and run the test, I get :

System.IO.FileLoadException: Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) --->  System.IO.FileLoadException: Could not load file or assembly 'System.Data.SqlServerCe, Version=3.0.3600.0, Culture=neutral, PublicKeyToken=3be235df1c8d2ad3, Retargetable=Yes' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).

I have uninstalled visual studio and reinstalled thinking I had a driver issue because I had beta products installed, but I get the same result.  I am at a loss of what to do about this.



Answer this question

Could not load file or assembly 'System.Data.SqlServerCe'...

  • amed

    I seemed to have narrowed down the issue.  I am using PPC 2005 btw.


    The above error occurs if I am using the built in Unit Testing in Team Edition.  If i strip out that stuff and just have a simple connection object (outside a test harness) it works fine.  Has anyone been able to do TDD using win mobile and sql mobile 2005   

  • Paul Deckers

    UT is not supported for devices, so the answer is no.



  • JocularJoe

    Hi,

    I have developed a project for Pocket PC 2003 and when i install that to device HP 2200, then its shows error.

    Error: File or Assembly : system.data.sqlserverce version 3.0.3600.0 Token No." " or one of its dependencies not found.

    Please tell me how can i remove this error. I am using .Net 2.0 pocket pc 2003 for developing the project. Please send me the answer as soon as possible and at my ID thats given below......................................

    Thanks

    Shalabh Gupta

    shalabhgupta16@hotmail.com

    shalabhgupta16@yahoo.com



  • Maheshkumar.R

     Ilya Tumanov wrote:

    UT is not supported for devices, so the answer is no.



    well that is garbage.  anyway, for this example i wasn't testing anything using mobile, just a simple sql mobile connection.

  • halfpint

    Hi Mike,

       Which project you are working on   
       PPC2003/PPC2005/SPH2005/WCE42/WCE50/WIN32

       Also is it the device or emulator

       Can you try installing VS 2005 on a very clean machine (no uninstalls and installs) and see if it repros.  Basically we want to figure out whether it is a setup issue or a functional issue.

    Thanks,
    Laxmi NRO, MSFT, SQL Mobile, Microsoft Coporation

  • Could not load file or assembly 'System.Data.SqlServerCe'...