Web.config transformations

Posted by Community Admin on 04-Aug-2018 22:25

Web.config transformations

All Replies

Posted by Community Admin on 23-Jul-2011 00:00

I typically use Web.config transformations in my Web Application projects to control settings in my Web.config files specifically for deployment scenarios between development, staging and production.

I noticed that the connection string information is now stored in DataConfig.config instead of in the Web.config file.  I also did not seen an include element for the connectionStrings element in the Web.config file.

Therefore, how do you support standard Web.config transformations in Web Application projects in Sitefinity v. 4.x since non-Web.config files do not support Web.config transformations by default through Visual Studio 2010?

Posted by Community Admin on 26-Jul-2011 00:00

Hi Samir Vaidya,

Yes, Sitefinity stores the connection strings in the DataConfig.config by default, however having the connection string in the web.config is also supported.

So, you can move the Sitefinity connection string from DataConfig.config to the the web.config in order to take advantage of the transformations feature.

If you do this, consider the followong:
1. If you have connection strings with the same name in the DataConfig.config and web.config, those one in the web.config will be ignored.
2. The connection string in the DataConfig.config has an attribute 'dbType', which is not supported by the connection string element in the web.config. This attribute can be included as a parameter in the connectionString.
For example, if you have this connection string in the DataConfig:

<add connectionString="data source=xxx;Integrated Security=SSPI;initial catalog=xxx" providerName="System.Data.SqlClient" dbType="MsSql" name="Sitefinity" />

It should be  moved in the web.config as:
<add connectionString="data source=xxx;Integrated Security=SSPI;initial catalog=xxx;Backend=mssql" providerName="System.Data.SqlClient" name="Sitefinity" />

In case you are using MSSQL, you can skip this parameter, because 'mssql' is the default. Currently, the supported values for the Backend parameter are: mssql, oracle, mysql, azure.

Hope this is helpful.

Best wishes,
Vlad
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-May-2013 00:00

Hi Vlad,

I'm trying to use web.config transformations to connect to my SQL Azure database. I've removed the connection string from dataconfig.config file and moved into the web.config but I get the error saying:

Wrong database backend configuration detected: Connecting to 'Microsoft SQL Azure (RTM) - 11.0.9041.121
Apr 24 2013 16:44:15
Copyright (c) Microsoft Corporation
' but configured for 'mssql'.

My connection string is set as mentioned in the thread above but seems that it doesn't understand the Backend=Azure part of the connection string.

Web.config -
<add name="Sitefinity" connectionString="Server=abc.database.windows.net;User ID=admin@abc;Password=@Bc123;Database=MyDbStaging;Trusted_Connection=False;Encrypt=True;Backend=Azure" providerName="System.Data.SqlClient" />

Posted by Community Admin on 21-May-2013 00:00

Hello David,

The connection string should be:

<add name="Sitefinity" connectionString="Server=abc.database.windows.net;User ID=admin@abc;Password=@Bc123;Database=MyDbStaging;Trusted_Connection=False;Encrypt=True;Backend=SqlAzure" providerName="System.Data.SqlClient" />

Greetings,
Nadezhda Petrova
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed