Prevent media folder being deleted when publishing from Visual Studio
Is there anyway to prevent the media folder from being deleted when you deploy a site via the Publish functionality in Visual Studio? I know I could uncheck the "delete all files on publish", but it seems sensible to keep the files and live files as neat as possible.
How do other people handle deployment of development once the site is live and up and running? I've seen lots about Courier and I'm using uSync, but I can't workout how to best hand deployment of the file system while maintaining the media folder.
I think I accepted that you can't tick the box 'Delete all file before publish' and that the way to do it would be to delete the file manually, taking care not to delete the media folder. Not ideal but doable. I also played with uSync, but that was for publishing the DB changes.
So the short answer is no, but I think you can work around it. If you find a solution let me know
What I usually do is I never include the Media folder in the csproj apart from the first time I deploy something on CI.
That way I get the original Media folder and from that point on, I have Courier to transfer things for me, without touching the folder while publishing (or deploying automatically in my case).
If you use Courier (or uSync, same difference sometimes) you could also completely ignore Media (remove from csproj) and then Have Courier or uSync create it for you (aka include those files when publishing).
Up to you. I've seen other people including the Media folder in a private nuget server and restoring from there on publish, but to each his own I guess.
Prevent media folder being deleted when publishing from Visual Studio
Is there anyway to prevent the media folder from being deleted when you deploy a site via the Publish functionality in Visual Studio? I know I could uncheck the "delete all files on publish", but it seems sensible to keep the files and live files as neat as possible.
How do other people handle deployment of development once the site is live and up and running? I've seen lots about Courier and I'm using uSync, but I can't workout how to best hand deployment of the file system while maintaining the media folder.
Hi Guy
I struggled with the same problem, did you find a solution?
Thanks,
Alex
Alex,
I think I accepted that you can't tick the box 'Delete all file before publish' and that the way to do it would be to delete the file manually, taking care not to delete the media folder. Not ideal but doable. I also played with uSync, but that was for publishing the DB changes.
So the short answer is no, but I think you can work around it. If you find a solution let me know
What I usually do is I never include the Media folder in the csproj apart from the first time I deploy something on CI.
That way I get the original Media folder and from that point on, I have Courier to transfer things for me, without touching the folder while publishing (or deploying automatically in my case).
If you use Courier (or uSync, same difference sometimes) you could also completely ignore Media (remove from csproj) and then Have Courier or uSync create it for you (aka include those files when publishing).
Up to you. I've seen other people including the Media folder in a private nuget server and restoring from there on publish, but to each his own I guess.
is working on a reply...