SQL Server 2008 – No Source Available-Collection of common programming errors
Hi Maheswaran ,
The error will occur when an application uses System.Data.SqlServerCe.Entity.dll from SQL Server Compact 3.5SP2 in xcopy deployment mode by copying the Compact’s ADO.NET provider (System.Data.SqlServerCe.dll) and the Compact’s ADO.NET EF provider (System.Data.SqlServerCe.Entity.dll) DLLs from the %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Private.
System.Data.SqlServerCe.Entity.dll and System.Data.SqlServerCe.dll are of version 3.5.1.50. But the System.Data.SqlServerCe.Entity.dll from the Private folder (i.e. with version 3.5.1.50) is referring to System.Data.SqlServerCe.dll from the Desktop folder (i.e. with version 3.5.1.0). Due to this, an application that has only the dlls from Private folder fails as it doesn’t find the 3.5.1.0 version of System.Data.SqlServerCe.dll.
The workaround is to add assembly binding redirection entry in app.config file.
Append following lines under the configuration section of the app.config:
Please refer to the SQL server Compact team blog for more details.
Hope this helps.