简体   繁体   中英

Publish different static files by deployment targets

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM