J. Cortese
J. Cortese

Reputation: 59

Msbuild parameter /p:PackageAsSingleFile=true is not producing a ZIP file

Build environment is VSTS(Azure). Task is "Visual Studio build". MS Build Arguments list /m:16 /p:_DestinationType=AzureWebSite /p:CreatePackageOnPublish=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation="$(build.artifactstagingdirectory)\"

There is one solution which contain three projects. The last Project(.csproj) should build web jobs which is why I need a .ZIP for deployment.

I included /p:PackageAsSingleFile=true but no .ZIP file is created.

What could be missing in .csproj which needed to produce a ZIP file?

No error message in build output.

Upvotes: 2

Views: 2556

Answers (1)

Origameg
Origameg

Reputation: 334

We experienced the same issue when someone accidentally removed the Microsoft.Web.WebJobs.Publish package reference from a webjob's .csproj

As soon as we put it back, the build pipeline started generating the .zip file again.

<PackageReference Include="Microsoft.Web.WebJobs.Publish">
  <Version>2.0.0</Version>
</PackageReference>

In our case the webjob targets Import statement was still there, but that's another thing to check:

<Import Project="..\Dependencies\Microsoft.Web.WebJobs.Publish.1.1.0\tools\webjobs.targets" Condition="Exists('..\Dependencies\Microsoft.Web.WebJobs.Publish.1.1.0\tools\webjobs.targets')" />

Upvotes: 1

Related Questions