Publish different static files by deployment targets

65 views Asked by At

I have an Web application with several deployment targets (DEV, PREPROD, PROD).I want visual studio to publish different version of a bunch of HTML and other static files by environnement. (the files have to be different when deploying on DEV or on PROD).

DEV:
MyWebSite\Content\Templates\Intro.html
MyWebSite\Content\Templates\IntroDEV.html

PROD:
MyWebSite\Content\Templates\Intro.html
MyWebSite\Content\Templates\IntroPROD.html

I can't apply transformations like for *.config files (with slowcheetah for example).

I'd like to replace Intro.html with IntroDEV.html when deploying on DEV and IntroPROD.html when deploying of PROD.

Is there any trick to do it ?

1

There are 1 answers

1
amit dayama On

You can set the configuration of your project as Dev, Prod or preprod and can choose the target in your msbuild script accordingly.

in your msbuild script you can check the envirnoment and then can replace the file as required.