I’m using SubSonic 2 from within a project and I’d like to specify a different .config file from the default App.config. How can I tell SubSonic to use a specific config file?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It appears that you can do this by setting two properties of SubSonic objects:
DataService.ConfigSectionandDataProvider.DefaultConnectionString. Once those are set SubSonic won’t try to look for the default application configuration file, it’ll just use the details you’ve given it.For example:
This appears to work well, however I am sometimes experiencing a long delay on the 2nd to last line
DataProvider provider = DataService.Provider;. I’m not sure if this is to do with what I’m doing here or it’s a general assembly-loading problem. I’ve documented this problem in another question here: Call to System.Web.Configuration.ProvidersHelper.InstantiateProviders taking ages and ages (from SubSonic)