I have an two exe's that are interacting with the same database. One is the main application, and the other is an updater application (updates the main application). I am trying to keep the installation package limited to one configuration file. IE I want the Updater application to use the main applications config file.
I was able to pull the connection string and create the database context like this:
string entityConnectionString = (entitySettings == null) ? "" : entitySettings.ConnectionString;
var ecb = new EntityConnectionStringBuilder(entityConnectionString);
var ec = new EntityConnection(ecb.ToString());
However, if I do not include the configuation for the updater application below, I get the error The specified store provider cannot be found in the configuration, or is not valid.
<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>
How do I tell Entity Framework or the application to use the other configuration file or get around this error message? Adding a config file for the updater exe is not an option, as boss man wants one config file. (We want to be able to remotely update the config files and adding multiple makes it more complicated.)