0

I currently have a very large .NET solution in Visual Studio 2017 containing 12 different projects. There is a single data access layer project that is utilized by most of the other 11 projects which consist of websites, class libraries, windows services, unit tests, etc.

One of the databases used in my DAL project changes the primary host nearly every week (completely outside of my control). In order to accommodate this change, it requires me to redeploy code at irregular intervals, against our standard deployment lifecycle.

Is it possible to have a single external file that is read upon application start to be used as the hostname in the entity framework connection string? I've tried splitting all of the EF connections out of the app/web.config files into their own ConnectionStrings.config, but entity framework throws a metadata error each time, or says that it cannot find the CSDL/SSDL/MSL files.

What I envision is simply updating a single text/config file with the adjusted database server name, then restarting each service/website/console app/etc., without having to truly deploy new code.

Any help would be greatly appreciated!

  • You definitely can use an external file for your connection strings. https://stackoverflow.com/questions/16148748/reading-connection-string-from-external-config-file – Steve T Dec 07 '18 at 20:14
  • Thank you, Steve. I've followed those instructions, but my issue pertains specifically to EF connections which include metadata for location of CSDL/SSDL/MSL files. I'm still looking for a solution if you have any other ideas. – UsernameNotAccepted Dec 12 '18 at 20:12

0 Answers0