Sunday, October 30, 2011

Adding SQL Server Compact 4.0 (CE) support to Visual Studio 2010 SP1

I just noticed that SQL Server Compact 4.0 tooling is not installed along with Visual Studio 2010 SP1 by default. 


Ofcource you can still make a SQL Server Compact 4.0 database using the latest build of EntityFramework from Nuget and using Code First development. However if you try to open the generated sdf file from Visual Studio you get the error "The operation could not be completed. Unspecified error" as shown : 


To fix this you can either install "Visual Studio 2010 SP1 Tools for SQL Server Compact 4" from the Web Platforms Installer or use the offline installer available here : http://go.microsoft.com/fwlink/?LinkId=212219 

Enjoy!