简体   繁体   中英

How can I overwrite file web.config with web.other.config?

I have a msbuild script with custom logic to deploy my service to the qa server automatically. I have to overwrite the default config with a dedicated one, but when I use <Copy SourceFiles="web.other.config" DestinationFiles="web.config" /> it does nothing.

How can I make it work?

Thats exactly what I do in my build scripts and it looks fine. Are you sure you not getting any file permission issues. when overwriting the file?

try deleting the destination file first if it already exists.

<Delete Files="web.config" ContinueOnError="false"></Delete>
<Copy SourceFiles="web.other.config" DestinationFiles="web.config"></copy>

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