4

I'm attempting to use Web Deploy to Publish a Web Application. I want Visual Studio to delete any files that no longer exist, so I've checked the "Remove additional files at destination" setting in my Publishing profile. However, I want VS to ignore the /Content/uploads folder, as it contains contents that my users have uploaded. Naturally, the contents are different in my development site than they are in the live site. Unfortunately, I have been unable to discover a way to make Visual Studio ignore this folder when publishing (it wants to delete all of the content, since it doesn't exist in the project). Does anyone know of a way to exclude specific folders on the target site from being examined by Web Deploy?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Ashley Reid
  • 488
  • 5
  • 10
  • I'm not sure I understand. My title was "VS 2012 Web Deploy wiping out user content." I wanted to specify VS 2012 Web Deploy as opposed to some random "Web Deploy". How is this different from posts like this one: http://stackoverflow.com/questions/3137880/how-to-get-visual-studio-publish-functionality-to-include-files-from-post-buil? – Ashley Reid Oct 17 '12 at 22:16
  • Perhaps the problem is the phrasing of my title? Would "How do I prevent Visual Studio 2012's Web Deploy from wiping out user content?" be a better title? – Ashley Reid Oct 17 '12 at 22:19
  • FYI, "Web Deploy" is not part of VS2012, really. It's mostly a separate component from the IIS people. I'll edit your title to make the distinction clearer. – John Saunders Oct 17 '12 at 23:09

2 Answers2

0

I had a similar problem, wanting to keep some files in the deployment package even though they're not part of the project.

Try to create a custom MSBuild target for this, that works for me.

Here is a Getting Started MSBuild reference

Hope this helps. All the best.

felipekm
  • 2,820
  • 5
  • 32
  • 42
  • Here is another add that can be useful: http://stackoverflow.com/questions/3137880/how-to-get-visual-studio-publish-functionality-to-include-files-from-post-buil – felipekm Oct 17 '12 at 19:32
  • 1
    Thanks for the replies. I've actually already been to both of those links in my search, and they don't seem to have what I'm looking for. They deal with including / excluding content from the deployment package. I'm looking for a way to exclude content that exists on the target server. – Ashley Reid Oct 17 '12 at 22:11
0

I was unable to find a suitable solution for this issue, so I've created my own: https://pubsync.codeplex.com/

PubSync enables quick and reliable file syncing for publishing Visual Studio projects.

Ashley Reid
  • 488
  • 5
  • 10