Q:

Entity Framework Code First Migrations failing on Wrong Provider (3.5 instead of 4.0)

I am trying to add a migration (for the first time) to a project using Entity Framework 6.0.2 for SQL Server Compact (code first). The application is having no problems communicating with the database. The migration is failing with the error message:

System.InvalidOperationException:
  No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.3.5'. Make sure the provider is registered in the 'entityFramework' section of the application config file. 

The project has never had any reference to SqlServerCe.3.5 and I cannot find one with Visual Studio find & replace command
The app.config file has:
<configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Data.SqlServerCe" publicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
      </dependentAssembly>
  </assemblyBinding>
</runtime>
<entityFramework>
  <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
    <parameters>
      <parameter value="System.Data.SqlServerCe.4.0" />
    </parameters>
  </defaultConnectionFactory>
</entityFramework>
<appSettings>
<system.data>
  <DbProviderFactories>
    <remove invariant="System.Data.SqlServerCe.4.0" />
    <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.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
  </DbProviderFactories>
</system.data>

Does anyone know how I can force migrations to use SqlServerCe.4.0 (+/- remove the reference to 3.5)? Thank you.
Edit
Many Thanks to Mr Sql Server Compact (ErikEJ) for his suggestions.
unfortunately, removing the binding redirect node just results in:

System.Data.Entity.Core.ProviderIncompatibleException: 
  An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.ArgumentException: The connection given is not of type 'SqlCeConnection'.

You are absolutely correct - this project is using private deployment. Referenced assembly versions for System.Data.SqlServerCe and System.Data.SqlServerCe.Entity are both to 4.0.0.1
Edit 2 - solved
I needed to remove the binding redirect node, as suggested by erik, AND add the provider to the EntityFramework node of the app config (the application uses code-based configuration of the provider services, so these were not included) as below
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
  <provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>

A:

Remove the binding redirect. It looks like you are trying to use private deployement, but are you using the correct System.data.SqlServerCe.dll (check the Assembly version). if it is 4.0.0.0 and not 4.0.0.1, then change to DbProviderfactories setting to point to the correct assembly version

