locked
How to avoid WDP copy all to Source Directory (also SVN!!) RRS feed

  • Question

  • User-1399539369 posted

     Hi!

    i see that Build WDP is very slow because it copies the entire source folder to a folder called "Source" at the same level of "Release"  folder.

    i would like to avoid that it copies

    1) All SVN folders and files

    2) some unuseful folders as css and images.

     

    the tag known Excludefrombuild don't resolve the problem!

     

    Any ideas or solutions?

     

    thanks!

    Wednesday, March 25, 2009 11:40 AM

All replies

  • User372121194 posted

    Hi,

    Web Deployment Project only copies the Output to destination you specified.

    What type of your ASP.NET project is? I guess it is ASP.NET web application.

    You can try to set this file's Copy to Output Directory to "Do not copy" by right clicking this file in Solution Explorer -> selecting properties -> changing Copy to Output Directory to "Do not copy".

     

    I look forward to receiving your test results.

     

    Monday, March 30, 2009 3:33 AM
  • User-1399539369 posted

     Hi! thank you for the help!

     

    the project type is ASP.NET Web Site .

    when i right-click on the folders containing css (but also on any kind of file/folder) i cant see any "Properties" menù item and any "Output directory" option in the properties panel.

    for each file, in the properties pane, i can see only

    "File Name" and "Full Path"  properties.

     

    byes!

    Monday, March 30, 2009 1:01 PM
  • User372121194 posted

    Hi,

    Thanks for your response.

    Please follow this article: http://stuffigoogled.com/2008/06/11/exclude-folders-from-an-aspnet-web-deployment-project/ to exclude files.

    If this doesn't help you, please post the Web Deployment project file here.

     

    Thanks.

    Monday, March 30, 2009 10:34 PM
  • User-1399539369 posted

     ExcludeFromBuild don't resolve my problem! i already use it.

    when i build a WDP i see this operations.

    *my sources (.aspx .vb .css .jpg etc. files) are in c:\project\aspx and wdp is in c:\project\wdp

    1. WDP copies the ENTIRE content of c:\project\aspx folder in c:\project\wdp\sources
      and this take several minutes as c:\project\aspx folder have 500mb of images, css, js, SVN files and compilation-unuseful files
    2. wdp compile project (it takes about 1 minute)
    3. wdp create and fill the c:\project\wdp\release folder with compiled file (except the files exluded by ExcludeFromBuild tags)
    4. wdp execute my custom tag command (like <copy> and <delete>)  to copy my custom external file and delete .svn folders
      (this take several minutes as i have to clone about 500mb of images and css)
    i wold like to avoid WDP copy 500mb of unuseful file in the step 1.

     many thanks for interesting in my problem!

    Tuesday, March 31, 2009 5:12 AM
  • User706013099 posted

    I have the same issue - does no one have an answer to this?

    If I do not have any ExcludeFromBuild statements then the Source folder is not created. But I also need to exclude a very large images folder and if I do this then the Sources folder is created. It appears that ExcludeFromBuild overrides the default behaviour but I can find no switch or option to avoid the source being copied.

    Jon

    Wednesday, July 29, 2009 5:13 AM
  • User-834955544 posted

    Hi, I just found the solution here: http://www.meadow.se/wordpress/?p=137

    It worked for me!

    Sunday, October 11, 2009 4:05 AM
  • User706013099 posted

    Did you really use this method to prevent VS2008 copying all of your source files to a folder called Source? Or are you just talking about excluding other files such as images? AFAIK ExcludeFromBuild does not help here. As I said earlier, if I do not have any ExcludeFromBuild statements then the Source folder is not created - but if I do (and I have to) then it is.

    Monday, October 12, 2009 8:49 AM
  • User-834955544 posted

    I used this method to exclude entire directories in my project. In my case (and by default), WDP was copying the all the files including .SVN files and directories to the Source folder... which are useless for production deploy.

    This the part of my .wdproj file which I added manually (the rest was auto-generated):

         ...

        <ItemGroup>
            <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\.svn\**\*.*"/>
            <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\obj\**\*.*"/>
              ...
            <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\*.csproj.*"/>
        </ItemGroup>

        ...


    Wednesday, October 28, 2009 5:17 AM
  • User149274179 posted

    Hey all,


    Though couldn't find a way to prevent the source folder from being created, you could still DELETE it after building your project. Voila:


    <Target Name="AfterBuild">
    <RemoveDir Directories="Source" />
    </Target>

     <Target Name="AfterBuild">

    <RemoveDir Directories="Source" />

    </Target>

    Tuesday, November 10, 2009 11:45 AM