locked
DeployOnBuild does not work RRS feed

All replies

  • User-1659704165 posted

    Where I Put Most of Build Script..

    Project --> properties --> Build Event


     and put Scripts In Eithere Pre Build or Post Build

    Thursday, June 2, 2011 4:13 AM
  • User-713418278 posted

    hi qwe123kids

    thanks, but I dont want to perform this with the build events - I just need to setup the "Package/Publish" web at the end of build according to the dosumentation. At the mentioned MSDN doc is nothing about the postbuild events.

    Regards

    Miroslav

    Thursday, June 2, 2011 4:30 AM
  • User1764690921 posted

    Hi the documentation is incomplete. You must specify these properties before the <Import declaration for Microsoft.WebApplication.targets

    Note:

    • This will not take effect inside of Visual Studio, but will for command line builds

    If you want to create a package even when you are building inside of Visual Studio then you must employ a different techinque. We need to manually inject the Package target into the build process. To do this define the follwoing property:

    <PropertyGroup>
      <BuildDependsOn>
        $(BuildDependsOn);
        Package
      </BuildDependsOn>
    </PropertyGroup>

    Note:

    • This has to be placed AFTER ( not before like the previous one) the <Import for Microsoft.CSharp.targets

    Sorry for the consusion, I have asked the tech writer to update that document.

    Friday, September 30, 2011 12:12 AM
  • User126536200 posted

    How can I make this work with Team Foundation Build? I have added the <PropertyGroup><BuildDependsOn>... and that works fine when you build locally but when TFB builds my solution it shows me circular dependencies errors:

    Unhandled Exception: Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: MSB0001: Internal MSBuild Error: Global Request Id 19 has not been assigned and cannot be retrieved.

    Tuesday, November 29, 2011 5:02 AM
  • User998387912 posted

    Its now 2015. I'm just trying to upgrade our solution from VS2010 to VS 2013

    I've applied VS2013 Update 5 and now the build process knows about our setup project (VDProj). I'm trying to create a package based on a pubxml definition, which replaces the old web deployment project. 

    I'd like to have VS (on my desktop) create the package when I do a  release | anyCPU build - then I can test it without touching the build server..

    I'd also like to use that on the build server, via the TFSProj file, and have the VDProj pick up the deployment package, and include it in our MSI (the MSI also includes documentation, desktop components & stuff).

    I can build the package in VS2013 by right button click...Publish and choosing the pubxml, but I cant persuade the "normal" build to create it.

    I found    https://msdn.microsoft.com/en-us/library/ee942158 v=vs.110).aspx#can_i_specify_that_a_package_should_be_created_every_time_i_build_a_solution

     I've added the section

    <PropertyGroup>
      <BuildDependsOn>
        $(BuildDependsOn);
        Package
      </BuildDependsOn>
    </PropertyGroup>

    after the <Import for Microsoft.CSharp.targets, as the updated docs say, and I've placed the DeployOnBuild further up:

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

       <DeployOnBuild>True</DeployOnBuild> has a squiggly red line under DeployOnBuild

        <DeployDefaultTarget>Package</DeployDefaultTarget>

        <DebugType>pdbonly</DebugType>

        <Optimize>true</Optimize>

        <OutputPath>bin\</OutputPath>

        <DefineConstants>TRACE</DefineConstants>

        <ErrorReport>prompt</ErrorReport>

        <WarningLevel>4</WarningLevel>

      </PropertyGroup>

    However this does not create the package when I click Build on the VS menu.

    Also how can I specify WHICH pubxml to use - potentially I could have several?

    (I'm not a build guy, so I'm starting from ground zero)

    Wednesday, July 29, 2015 8:51 AM