简体   繁体   中英

Publish web app but not overwrite app_data but delete existing files?

Ok, I guess I never got this sorted out or cant remember how to preserve the app_data folder when using a publish profile from within vs. Have a older webforms project using vs 2019 and published to a folder on a server using a unc path. Works fine, but I need to not overwrite the app_data folder. In the publish profile there are a few options such as
delete exsting files
exclude files in app_data

If I want the app_data folder left intact on the target, then should I not use delete existing files? Trying that, even with exclude files from app_data, the app_data folder is still deleted. Only if I uncheck "delete existing files" does app_data on the target stay intact.

We can avoid deleting the App_Data folder when publishing by using below command:

-skip:Directory=\App_Data

Check these links:
Make MSDeploy (Visual Studio) not delete App_Data folder but delete everything else
https://forums.iis.net/t/1191873.aspx?Avoid+deleting+App_Data+folder+when+publishing+

Delete existing files will delete all files in the physical path of the website before publishing the updated files.
Ticking exclude files in App_data means the files of the current App_Data folder will not be published into the physical path of the website resulting in that the existing AppData directory in the website will be preserved.
Feel free to let me know if there is anything I can help with.

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