Learn how to a build a cloud-first strategyRegister Now


how to exclude folder (on the production site) using Web Deployment Projects

Posted on 2007-07-30
Medium Priority
Last Modified: 2011-09-20
I am using Web Deployment Projects (http://msdn2.microsoft.com/en-us/library/aa479568.aspx) to publish my website. It seems to work great so far. However, I ran into a problem I haven't been able to solve.

I have a "Uploads" folder (with subdirectories) where I allow users to upload files.

When I publish my site, I want to tell Web Deployment Projects to leave the "Uploads" folder on my production site alone since I don't want to overwrite the files that users have uploaded.

How can I accomplish this?

I tried the following:
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\Uploads\**\*.*"/>

However, this simply deletes the "Uploads" folder on my production site and doesn't publish the "Uploads" folder from my project.

I then came across the following:

  <Target Name="AfterBuild">
    <MakeDir Directories="$(TargetDir)\Uploads" />

I believe this will simply delete the "Uploads" directory and recreate it.

Is there any better way of doing this?
Question by:IUAATech
1 Comment
LVL 18

Accepted Solution

DropZone earned 1500 total points
ID: 19679150
Apparently there is no real way to "ignore" folders from the remote server.  The ExcludeFromBuild is intended to prevent test and other non-production files to be included, and that's why it removes them from the remote server.

I suggest deploying to an intermediary folder, and then copying from there.  You can create a batch file or some sort of script to automate this.


Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question