Oct 08, 2018 03:37 PM|NewToDotNet|LINK
Thanks. I know it might sound silly, but I was hoping to avoid the configuration transformation for a few reasons. One of them is that I like to keep production and what I will call Frozen (which is a direct mirror of production so that I can test production
problems without affecting production) 100% in synch. Different web.configs defeat this or at least could possibly interject an unintended difference. To further complicate this my app consists of both an MVC front end and a phone UI that use WebApi to access
my business logic and database.
My plan is to run the following at app startup. I am creating a helper class that reads a text file to determine which of the connection strings from my web.config to use (production, development, frozen...etc). Then using the connection manager set the
proper connection string). Later my back end code will invoke a method on this helper class to return the proper connection string.
This means that with the exception of a one line text file, my environments remain in 100% synch.
I can't think of a better way to do this.