Web.Config transformations - What to do with connectionString.config if I do not use Web Deploy?

3

My Web.config points to an external connectionString file.

<?xml version="1.0"?>
<configuration>
  <connectionStrings configSource="connectionStrings.config"/>
</configuration>

So far without news. The problem is that I use Web.Config File Transformation and my deploy process is in File System. I do not use Web Deploy.

In the publish screen I have the information that DataBase Publish is not supported in this Publish method. In summary, it does not work with File System.

TosolveIthoughtaboutcreatingaconnectionStringfilefortesting,homologationandproduction.InmyprojectthenIwouldhaveaconnectionString.configfile,anothercalledconnectionStringProducao.config,anotherconnectionStringHomologa.configandsoon.

Andchangeinthetransformationasbelow:

<configurationxmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <connectionStrings configSource="connectionStringsProducao.config" xdt:Transform="Replace"/>
  <system.web>
   //...
  </system.web>
</configuration>

I think it will work, but I think it is a gambiarra. Does anyone have a better solution?

    
asked by anonymous 15.06.2015 / 23:23

1 answer

1

Yes. Publish to local IIS.

  • Install Web Deploy on your local IIS ; / li>
  • Create a website in your IIS;
  • Set up a Deploy file (in the link you have the steps);
  • Import the file created in your VS;
  • In the database part, check to not run Migrations , or to not update Update Database );
  • Publish. Make sure the Web.config file has been properly transformed.
16.06.2015 / 00:12