TFS 2015 Visual Studio Build - Package .zip not being created

前端 未结 3 1078
花落未央
花落未央 2021-01-16 01:30

I\'m trying to build my solution and package up the web app into a web deploy (.zip) package to be deployed.

I\'ve added the Visual Studio Build ste

相关标签:
3条回答
  • 2021-01-16 02:18

    Make sure the ASP.NET development workload of Visual Studio is installed.

    If DeployOnBuild is having no effect, you may need to install the ASP.NET Development "workload" with the VS setup tool.

    There are specific .targets files that, if they don't exist, cause these parameters to be silently ignored. Installing this adds those .targets and the parameters become active, allowing the .zip to be created.

    For me (VS 2017) the relevant target file (or one of them, anyway) that was missing but is needed is:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets

    If it is missing, you'll need to install as above, and if it is there, then you have a different problem. ;)

    0 讨论(0)
  • 2021-01-16 02:24

    First suggest you manually remote in the build agent and build the project through MSBuild command line with arguments to see if the project builds properly.

    This will narrow down the issue is related to the environment on your build agent or your build definition.

    You should directly use /p:PackageLocation=$(build.stagingDirectory

    Besides since you have multiple assemblies that are referenced in the web app. Please also double check dependencies that are building in the correct order or referenced correctly.

    0 讨论(0)
  • 2021-01-16 02:31

    I have tried the same on VS2015 MVC web application using VSTS and TFS 2015.2.1 both. I had to do a slight change to the Build arguments in Visual Studio build. That is removing the trailing "\" in /p:PackageLocation="$(build.artifactstagingdirectory)\".

    Here is the argument I passed to Visual studio build step

    /p:DeployOnBuild=True /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation="$(build.artifactstagingdirectory)"
    

    Then I used Copy and Published Build Artifacts (Deprecated in VSTS you should use Copy task and Publish task instead of this task) as shown below

    This gives me output as below.

    0 讨论(0)
提交回复
热议问题