I am using MV4 and EF5. Is there a way to have EntityFramework Migration pull the connection string from web.debug.config or web.release.config.
Running update-database seems to throw an error unless the connection string is in web.config
The web. config file has also been replaced in ASP.NET Core. Configuration itself can now be configured, as part of the application startup procedure described in Startup.
In the past Web. config was used for both IIS configuration and application configuration and settings. But in asp.net 5 it is not used by the application at all, it is only used for IIS configuration. This decoupling of the application from IIS is part of what makes cross platform possible.
Yes, we can run an ASP.NET web application without web. config file but without in debugging mode. If we don't configure any settings in web. config file then it consider machine.
That's because web.config is where the connection string should be found. Web.release.config
and Web.debug.config
are configuration transformations based on the current "Solution Configuration". See this MSDN article for details.
The short answer is, of course the connection string is expected to be in Web.config, because that's where it's designed to live.
You can use the -ConnectionStringName or -ConnectionString parameter on Update-Database to specify a different connection for the migrations.
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