Our software works as an add-in for Autodesk Inventor. This means our application (consisting of DLL's) folder is completely separate from the EXE.
The problem is with Entity Framework trying to load the SQL CE provider, which is privately installed next to the rest of DLL's in our application. I get the following error when running the application on a machine where SQL CE has not been installed:
System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
at System.Data.Entity.Infrastructure.SqlCeConnectionFactory.CreateConnection(String nameOrConnectionString)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at ...
If I copy all of the SQL CE installation files to the bin folder of Inventor (next to the main EXE), it all works fine, but this is not an option.
I have already investigated a few topics, suggesting to modify the app.config, specifying a different provider. All of them similar to this and that. But it doesn't work in my case. The app.config modification doesn't help me specify the location of the provider and even if it did, modifying the config is not an option (unless I can have a separate config).
Is that even possible? I would like to specify the location of my installation folder, so Entity Framework can look there for the SQL CE provider.