title: MSBUILD web deploy package does not include the project reference DLL's
body: <p>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.  </p>
  
  <p>I've looked at <a href="https://stackoverflow.com/questions/1132243/msbuild-doesnt-copy-references-dlls-if-using-project-dependencies-in-solution">this post</a> 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.</p>
  
  <p>I'm using MSBUILD 4 to create the package.</p>
  
  <p>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.</p>
  
  <p>I've tried changing the location of the _PackageTempDir and that did not solve the problem either.</p>
  
  <p>I've tried taking out the ExcludeFilesFromDeployment property and set the PackageAsSingleFile setting to false to see if that would change the results.</p>
  
  <p>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.</p>
  
  <pre><code>  &lt;Target Name="Package"&gt;
      &lt;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;"&gt;
      &lt;/MSBuild&gt;
    &lt;/Target&gt;
  </code></pre>
  
  <p>Any ideas as to why it is not including my referenced project dlls?</p>