none
Could not load file or assembly 'System.Data.SqlServerCe, Version 3.5.0.0

    Question

  • We just upgraded our applications from VS 2005 to VS 2008 and discovered we had to convert our SQL Server CE databases. So I did that. I then included the sqlce...35.dlls in the application directory on my test computer as well as the System.Data.SqlServerCe.dll version 3.5.

     

    sqlceca35.dll

    sqlcecompact35.dll

    sqlceer35EN.dll

    sqlceme35.dll

    sqlceoledb35.dll

    sqlceqp35.dll

    sqlcese35.dll

     

    When I run the app and it tries to load the System.Data.SqlServerCe.dll I get the following error:

    System.IO.FileLoadException: Could not load file or assembly 'System.Data.SqlServerCe, Version 3.5.0.0...or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

     

    We have the application targeting the .NET Framework 2.0 and need to keep it that way for awhile.

     

    Any ideas on how to resolve the error?

    Thursday, May 08, 2008 8:04 PM

All replies

  • Make sure you have updated any Project references to point to the 3.5 managed DLL, usually located at:

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

     

    Saturday, May 10, 2008 11:06 AM
  •  

    You can try with "Copy Local = true" for the references.
    Sunday, May 11, 2008 2:22 PM
  • I've encounted the same problem some times .
    These steps may be helpful for you .

    1) If your references are located in the application folder, then make sure all the dlls are copied.
    And confirm the version are same.(such as 3.5.0.0 or 3.0.0.0)

    2) If the app.config file existed, check it . This file could redirect assembly references version at run time .
    Such like    
        <assemblyBinding xmlns="urnTongue Tiedchemas-microsoft-com:asm.v1">
                <dependentAssembly>
                    <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845DCD8080CC91" culture="neutral"/>
                    <bindingRedirect oldVersion="0.0.0.0-9.0.242.0" newVersion="3.5.0.0"/>
                </dependentAssembly>
            </assemblyBinding>

    3)If you still have no idea to solve this problem.I recommend you download DILE from sourceforge.net ,this good tool allow you see more debug informations .
    Thursday, May 15, 2008 3:07 PM
  • Were you able to resolve your issue & if yes, then how, i am facing the same problem as you.
    Wednesday, July 14, 2010 6:41 PM
    • Proposed as answer by MiniJ Tuesday, April 09, 2013 6:06 PM
    Tuesday, April 09, 2013 6:05 PM