1.First of all create three different environment with
i.Debug .To work with local environment
ii.Staging .To work with Test environment where we will put latest feature
iii.Production .To use in production environment
2.Use both Xsd transformation and Single to pattern with pragma directive in c# to work with different environment of connection String ,Site Url, Api key etc .Create three different Web.config for this purpose .Two debug and release is already present .Use Third Web.Staging.config to put your xsd code here .