1
votes

I created a project as described here using Visual Studio 2010 and .NET 4 (Win7/x64). Once I've change the platform target to 'Any CPU' the sample project works. However, if try to generate a model from entity data model (right-click the model and select 'Generate Database from Model'), I get the following error.

Could not find the appropriate DbProviderManifest to generate the SSDL. The supplied provider invariant name 'System.Data.SqlServerCe.3.5' is not valid.

I have a reference to System.Data.SqlServerCe on my project.

3

3 Answers

2
votes

I appear to have just fixed

Error 175: The specified store provider cannot be found in the configuration, or is not valid.

when opening the .emdx eitehr as XML or in the designer.

I needed to add the element

<add name="Microsoft SQL Server Compact Data Provider"
     invariant="System.Data.SqlServerCe.3.5"
     description=".NET Framework Data Provider for Microsoft SQL Server Compact"
     type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>

To my machine.config as a second entry under <configuration><system.data><DbProviderFactories> (alongside a similar one for SQL Compact V4).

This made it match another system where I wasn't getting error 175.

NB. Adding this to app.config wasn't sufficient for the designer (searching the web indicates this is needed at runtime if the CE 3.5 tools have not been installed).

2
votes

An update to @Richard 's answer:

In the case of using SQL Server Compact Edition v4.0, you should have the following lines in your machine.config file:

<system.data>
  <DbProviderFactories>
  <add name="Microsoft SQL Server Compact Data Provider 4.0"
       invariant="System.Data.SqlServerCe.4.0" 
       description=".NET Framework Data Provider for Microsoft SQL Server Compact"
       type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
  </DbProviderFactories>
</system.data>