Moved to ef 4.3 with
AutomaticMigrationsEnabled = true;
In web.config have the following settings:
<appSettings configSource="appSettings.config" />
<connectionStrings configSource="connectionStrings.config" />
In Package Manager Console execute
update-database -verbose
and got the following error:
System.Configuration.ConfigurationErrorsException: Unable to open configSource file 'connectionStrings.config'
The error is understandable: it tries to open connectionStrings.config file from the working directory which is not the root project directory where connectionStrings.config file exists.
If connectionStrings.config and appSettings.config content to be moved to the web.config all works like a charm.
Is it a bug a it can be solved somehow?
When the migrations are run, it appears that binaries and the config file are copied to a temp directory. The files referenced as configSource are not copied over. I've tried marking the configSource files to be copied in the build, to no luck.
I reverted back to putting the connection string right into the app.config of the class library that contains my dbcontext and migrations. I have a separate class library for that, so my web.config of the main web project can still use configSource.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With