WAP, Publish, MSBuild

Last post 04-27-2006 8:26 PM by Trendy. 2 replies.

Sort Posts:

  • WAP, Publish, MSBuild

    04-25-2006, 7:46 PM
    • Member
      5 point Member
    • ervwalter
    • Member since 04-25-2006, 11:17 PM
    • Posts 1

    The latest release of WAP is really quite good.  Nice work! 

    Some background...

    My team would really like to swtich our app from a WSP to a WAP and are looking at how we would get deployment working.  We do a bunch of development and check our changes in.  Then periodically a build server (not Team Build) retrieves the latest code from source control (not Team System), compliles using msbuild, and copies the production ready file to an appropriate network location to be packed up into an installer.

    Currently, we use a WSP and WDP.  WDP calls aspnet_compiler, merges the DLLs, and we end up with the clean production ready files in a directory.  Not bad.

    We're looking to accomplish something similar with a WAP, and are stuck.  Options that almost work:

    • The GUI Publish function in WAP with the "only files needed to run the website" option is nearly perfect, but it's GUI.  Is this functionality available from the command line via msbuild?  I didn't see it.  This doesn't precompile the application, but that is not quite the end of the world.  It's clunky, but we could manually call aspnet_compiler on the published output followed by aspnet_merge.  I think that works, except for getting publish functionality in non-GUI form. Heck, although it would be a performance hit, we could probably even live without the precompiling/merging if the publishing functionality were just available via msbuild.
    • We could use WAP with WDP, but there doesn't seem to be any way to get "only files neede to run the website" functionality.  You end up with .csproj file, obj subdirectory stuff, etc in the final output and no non-manual way to clean up the stuff that shouldn't be there for production use.

    I am thinking of creating some msbuild targets of our own that do these steps which I think basically replicates the GUI publish functionality from the WAP:

    1. Copy the @(Content) items from the web project to a temp directory
    2. Copy all the stuff in the bin\ directory to the temp directory

    Could tack aspnet_compiler and aspnet_merge on the end there I guess as well.

    But before I start digging into that, has this issue come up before and how have people solved it?  Is publish-via-msbuild coming for the real release of WAP?  Anyone have any better suggestions?

  • Re: WAP, Publish, MSBuild

    04-26-2006, 3:06 PM
    • Member
      5 point Member
    • Jim Cline
    • Member since 04-26-2006, 7:06 PM
    • Posts 1
    I am needing the same publish functionality. Please let me know what you come up with...
  • Re: WAP, Publish, MSBuild

    04-27-2006, 8:26 PM
    • Member
      5 point Member
    • Trendy
    • Member since 04-27-2006, 8:10 PM
    • Posts 1
    I just encountered the same problem with WAP & WDP, i worked around it by adding a few lines to the the WDP project file (right click on the WDP and select 'open project file')  to do the clean up for me.

    This is for a vb project (hence the My Project folder, i dont think CS has that but i may be wrong).

      <ItemGroup>
        <!-- Delete Files doesnt accept wildcards, need to use an item group to obtain the file listing -->
        <ThingsToDelete Include="$(OutputPath)\*.vbproj.*;$(OutputPath)\*Test.config" />
      </ItemGroup>
      <Target Name="AfterBuild">
        <!--Clean up output directory -->
        <Delete Files="@(ThingsToDelete)" />
        <!-- seems putting this in the ItemGroup breaks the delete -->
        <Delete Files="$(OutputPath)\mssccprj.scc"/>
        <RemoveDir Directories="$(OutputPath)\My Project" />
        <RemoveDir Directories="$(OutputPath)\obj" />

        <!-- Create Production Logging Dir -->
        <MakeDir Directories ="$(OutputPath)\Logs" />
      </Target>


    It would be nice if it took care of that by default, but cleaning up afterwards is the next best thing. So i hope that saves you a bit of work, it certainly beats manually cleaning it up.

    Tim
Page 1 of 1 (3 items)