1

We have a VS 2017 Solution with a main web project in it. We also have 3 other web projects - these are modules that depend on the main web project. However, the main web project doesn't reference or known anything about that modules. When the solution builds the modules copy their output to the bin folder of the primary web project. The modules must depend on the latest version of the main project, so it needs to build main first and then the modules. This all works great locally - the site loads the modules work etc.

We are currently using Octopus and its Octopack step runs after Solution and gets all the files. We are trying to move to just using VSTS and are having problems getting the module files into a standard web deploy zip.

When MSBbuild runs on Solution it creates a zip file per web project. The zip file for the main project doesn't contain the Dll files for the modules (even though they are in bin folder). Therefore when we deploy via VSTS site is missing the modules. How do we tell MSBuild to create a single webdeploy package for the solution including the built modules?

The MSBuild command is basically the out the box one from VSTS:

/p:DeployOnBuild=true
/p:WebPublishMethod=Package
/p:PackageAsSingleFile=true
/p:PackageLocation="C:\temp\web.zip"

As far as I can see MsBuild is making the webdeploy zip before the other solution items copy their contents into the bin folder. MSBuild is a bit of a mystery to me at the best of times.

GraemeMiller
  • 11,973
  • 8
  • 57
  • 111
  • I think this is largely a case of MSBuild not caring about unreferenced files as per here https://passiondev.wordpress.com/2013/12/23/azure-website-deployment-additional-dependencies/. So think I just need to build the solution - then have includes that are conditional on the files existing in a 2nd build - hopefully can figure that out – GraemeMiller May 16 '17 at 13:14

1 Answers1

0

Largely this is just a case of making MSBuild include extra files that aren't part of the project. The pack web project publish only cares about files that are included in the project.

I updated main web project Csproj file following the guide in this question How do you include additional files using VS2010 web deployment packages?. I ran MSBuild once to build Solution so module dll files were available and I then ran MSBuild again with main web project to create the WebDeploy output with the extra included files.

Not sure this is the best way - seems a bit convoluted just to add some files but it works.

Community
  • 1
  • 1
GraemeMiller
  • 11,973
  • 8
  • 57
  • 111
  • Thanks for sharing your solution here, you could mark it as the answer until after a grace period, so it could help other community members who get the same issues. – Leo Liu May 17 '17 at 06:57