Objective
Supporting a file-type database similar to Access is essential for some green-installed applications. Applications developed using the RAFY domain Entity Framework can be ported to a simple sqlce 4 file database without changing one line of code, directly from a large database management system. (For the reasons for choosing to use SqlCe 4 as a file database, see: OEA 2.11 supports stand-alone databases-SQLite vs. SqlCe). )
This article explains how to quickly configure your Rafy application so that you do not need to modify any of the code, so that applications that originally support distributed deployment and connect SQL Server are converted to use the SQLCE database to support green deployment.
Copy sqlce 4 Related assemblies
First, you need to copy the SqlCe files to the project that corresponds to the execution file:
Reference System.Data.SqlServerCe:
Set the copy to Output Directory property for all files in the AMD64 and x86 folders that you just copied into the project to "copy if newer" so that all the files in the two folders are automatically copied in the Compiled folder: