I am working in the web.config transformation file concept. I have three web config. One is Staging, Production, Deployment. I have different connection information for these three.
Web.Config:
<connectionStrings>
<add name="MyGallery"
connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DevelopmentStorageDb;Data Source=BALA\SQLEXPRESS" />
</connectionStrings>
Web.Config.Production:
<add
name="MyGallery"
connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SharePoint_Config;Data Source=BALA\SQLEXPRESS"
xdt:Transform="Replace" xdt:Locator="Match(name)"
/>
Now I build the code it is working fine. I have created the package. When I run the code in Production mode the new connections string is not taking up.
How can I solve this. Do I need extra effort to move this to somewhere
The naming to be used is Web.Production.Config instead of Web.Config.Production...
Also the more optimal transform to use here is xdt:Transform="SetAttributes(connectionString)" that way the XDT engine will only modify the connectionString attribute and keep the add node as is...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With