locked
Web deploy package does not include the project reference DLL's RRS feed

  • Question

  • When I try to create a package for web deploy using msbuild it only includes the projects dll.  The package zip file or the temp directory does not include the referenced project's dlls.  
    I've looked at  this post and that is not my problem.  I am definitely using the code from the referenced projects in my main project that I'm creating the deployment package for.
    I'm using MSBUILD 4 to create the package.
    When I create the package using VS2010 using the exact same project file it works fine.  All the referenced projects have their dlls included in the package.zip file.
    I've tried changing the location of the _PackageTempDir and that did not solve the problem either.
    I've tried taking out the ExcludeFilesFromDeployment property and set the PackageAsSingleFile setting to false to see if that would change the results.
    Here is my target for Package.  All the regex is so I can pull my project file name off the end of a search path and then use that name for the name of the output folder and the name of the zip file.  The PackageOutputDir is a propertyI am importing.
          <Target Name="Package">
            <MSBuild Projects="@(PackageProject)" Targets="Package" Properties="Platform=$(Platform);
           Configuration=$(Configuration);
           DeployOnBuild=true;
           DeployTarget=Package;
                                               PackageLocation=$(PackageOutputDir)\$([System.Text.RegularExpressions.Regex]::Split($(ProjectName), '(.*\\)([a-z,A-Z,0-9,_,-]+)(\.\*proj;)')[2])\$([System.Text.RegularExpressions.Regex]::Split($(ProjectName), '(.*\\)([a-z,A-Z,0-9,_,-]+)(\.\*proj;)')[2]).zip;
                                               PackageAsSingleFile=true;
           ExcludeFilesFromDeployment=Web.config;
           _PackageTempDir=$(PackageOutputDir)\temp;">
            </MSBuild>
          </Target>
    Any ideas as to why it is not including my referenced project dlls?

    Tuesday, August 16, 2011 12:10 PM

Answers

  • The full answer is here.  Basically with DeployOnBuild set to true it only put the dll for the current project.  With DeployOnBuild set to false it includes the referenced projects dlls.

    Thanks for your help!

    • Marked as answer by fbanderson Wednesday, August 24, 2011 1:39 PM
    Wednesday, August 24, 2011 1:39 PM

All replies

  • Hello,

    Is the assemblies set as Copy local? (Or <Private>True</Private> in msbuild Script) I tested on my side, any assemblies with Copy Local = ture will be embeded into the zip file no matter we call from VS IDE or MSBuild command line.

    To investigate the root cause, I think we need compare the detailed build logs between which generated from VS IDE and MSBUILD. To enable the detailed or diagnostic log, you need to set it at Tools\Option\Projects and Solutions\Build and Run\ in VS IDE and use/verbosity:level for msbuild command line

    As a workaround, we can create a pre-package task to copy all required DLLs into Bin and set FilesToIncludeForPublish to include all files for the project.

    Yi

     


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Wednesday, August 17, 2011 9:23 AM
  • Hello,


    Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.
     
    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 22, 2011 8:35 AM
  • The full answer is here.  Basically with DeployOnBuild set to true it only put the dll for the current project.  With DeployOnBuild set to false it includes the referenced projects dlls.

    Thanks for your help!

    • Marked as answer by fbanderson Wednesday, August 24, 2011 1:39 PM
    Wednesday, August 24, 2011 1:39 PM