12 responses to “MSBuild and including extra files from multiple builds”

  1. Scott Stafford

    In VS2012, the target you need to hook was renamed from:

    CopyAllFilesToSingleFolderForPackageDependsOn

    to:

    CopyAllFilesToSingleFolderForMsdeployDependsOn

    1. Dave S

      This was just what I was missing! Couldn’t for the life of me figure out why this wasn’t working.

      Thanks!

  2. Checkyourcode

    $(IncludeRootDir) is not part of any pre-defined msbuild setting. You apparently are referring to some custom variable and are not explaining it. What is it? How does it work? Where do you define it?

  3. Jacob T. Nielsen

    This article helped me a bunch. Thanks.

    Do you know of any way to include files that are not located on disk? I have a custom Task in which I want to generate some content that I want to publish via FilesForPackagingFromProject , but this only allows me to include files from disk.

  4. Publish extra dll files not included in the web project | Technology & Programming

    […] tried to add custom files (found here: http://blog.samstephens.co.nz/2010-10-18/msbuild-including-extra-files-multiple-builds/), here is my build file. I launch the BuildAll target in […]

  5. Ryan

    This article helped me a lot. However I was unable to get it to work in Visual Studio 2013. In my frustration I ended using all the concepts here, but adding a layer where I pass the copy off to a powershell script. The powershell script does the actual copy.

    I wrote a quick blog entry on it on Blogger, Check it out if anyone is interested (sorry for the formatting, It’ll improve when I have time to set up a good template).

    http://ryiosdotnet.blogspot.com/2014/05/using-msbuild-and-powershell-to-import.html

  6. Integrating Gulp into your TFS builds and Web Deploy - Code Cadwallader

    […] So what’s left?  Well, by default Web Deploy isn’t going to pick up any of our output from the Gulp pipeline since it isn’t a part of the project.  So we need to explicitly point it at our build output.  There’s a couple helpful articles that talk about the approach in more detail on ASP.net and by Sam Stephens. […]

  7. Ramachandra Rao Kuchimanchi

    Hi ,

    I did the same and i was able to see only this text in the output (diagnostics) . Kinldy let me know where i am going wrong.

    CopyAllFilesToSingleFolderForMSdeployDependsOn =
    CustomCollectFiles;
    ;

    I am building the whole solution which has one Azure Cloud Project and 1 worker role project.
    The AzureCloud Project(.csproj) is already importing “Microsoft.WindowsAzure.target”.

    Sample .proj file that i am passing to build
    ———————————————-

    12.0
    $(MSBuildThisFileDirectory)
    $(DefineConstants);$(CargoConstants)

    CustomCollectFiles;
    $(CopyAllFilesToSingleFolderForMSdeployDependsOn);

    $(BuildProperties);%(Properties)

  8. Ramachandra RAO k

    After going through the below article , i have tried adding an extra .txt file to my Package , but failed.

    Kinldy let me know where i am going wrong.

    Output Log (diagnostic) has only this info getting recorded.

    CopyAllFilesToSingleFolderForMSdeployDependsOn =
    CustomCollectFiles;
    ;
    Background.

    I am building the whole solution which has one Azure Cloud Project and 1 worker role project. The basic build (With dependsOnTargets=”Publish”) is enough to create the Azure (.cspkg) file . To the same package i wanted to add extra file (.txt file).The AzureCloud Project(.csproj) is already importing “Microsoft.WindowsAzure.target”. Should i need to expilicty import any of the targets (or) should i modify existing targets(which i don’t want to )

Leave a Reply