Could not load file or assembly System.Data.SqlServerCe

Problem

You get this error when running your application:

Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

Microsoft SQL CE 3.5 is not installed, but a 3.5 CE database is being used or Microsoft SQL CE 4.0 is not installed, but a 4.0 CE database is being used.

Solution

Install Microsoft SQL CE 3.5 that can be downloaded from http://www.microsoft.com/download/en/details.aspx?id=5783

 Install Microsoft SQL CE 4.0 that can be downloaded from http://www.microsoft.com/download/en/details.aspx?id=17876.

See Also

Part IX:  Troubleshooting Applications

Application Will Not Run

Application Runs But No Data is Displayed

Application Error Messages