Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Read connectionstring from external file

Vote:
 

Hi

I was wondering if there were any changes in EPiServer 7.5+ which enabled reading of connectionstrings from external files?

I have earlier created this topic http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=76526 which was more concerned with the earlier versions of EPiServer 7.

With the implemented method described in the above topic, I get a .NET exception complaining that the SQL-profile provider cannot read the connectionstring "EPiServerDB":

<add name="SqlProfile" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="EPiServerDB" applicationName="EPiServerSample" />

Any thoughts?

Best regards

Jesper

#87348
Jun 11, 2014 10:21
Vote:
 

Can you show us connectionStrings element from web.config?

#87356
Jun 11, 2014 11:52
Vote:
 

Sure it looks like:

<add name="EPiServerDB" connectionString="Data Source=[DB_SERVER_HERE];Initial Catalog=[DB_HERE];Integrated Security=SSPI;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

This is the connectionstring I want to move to an external file.

#87394
Jun 12, 2014 11:30
Vote:
 

Are you still adding connection string manually or you have connectionStrings.config file as source for <connectionStrings> element?

#87486
Jun 13, 2014 17:47
Vote:
 

I want to have an XML file containing connectionstrings for my dev, staging and prod development. In this XML file there is one setting that stores which of the connectionstrings to use.

So at the moment, we are not adding connectionstrings manually, but we are using the standard setup with a connectionstrings-file. If possible, we want to move all connectionstrings to an xml-file.

#87495
Jun 16, 2014 8:12
Vote:
 

How does <connectionString> element looks in web.config? 

And I would recommend to use configuration file transformations to deploy correct connection string for staging or production environment - cleans up config file and this is preferred way to deal with various environments and configurations.

#87502
Jun 16, 2014 9:58
Vote:
 

So did you get this fixed, becasue the same thing happened when I updated to 9.7 and moved the connections strings to an external config file in the root. I also configured to use another DB for membership user management.

#145899
Mar 15, 2016 8:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.