1
votes

I am using vnext build and i do not want to create zip folders of the packages. My current MSBuild parameters creates zip folders.

/p:CreatePackageOnPublish=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageLocation="$(build.stagingDirectory)"

--abc.zip --Packages.zip .... --test.zip

I am using the below MS build parameters but when i run the build it does create separate folders for individual projects under the same solution. Is there any solution for this ????

p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=$(build.artifactstagingdirectory)

2
There are two different MSbuild parameters, which one are you actually using ?PatrickLu-MSFT

2 Answers

1
votes

To publish multiple projects in different directories. You could achieve this by setting up publish profile for each project. Add publish profile for each project with same name.

Then you could use File system Publish Method to Publish the output to different directories for each project.

Call the Publish profile in the Ms-build Argument.

/p:DeployOnBuild=true;PublishProfile=yourProfileName

This will not package the file and create .zip folders. For more details such as create publish profile, please refer this tutorial (even it's related to old XAML build)-- How to Publish multiple Web Projects in one Solution with TFS Build

1
votes

Using relative path (....\a\WebMVC) in publish profile (the profile file names are the same for these projects, e.g. MyPublish.pubxml), for example:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>True</EnableUpdateable>
    <DebugSymbols>False</DebugSymbols>
    <WDPMergeOption>DonotMerge</WDPMergeOption>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>..\..\a\WebMVC</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>
</Project>

Then the argument: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="MyPublish"

You also can add multiple Visual Studio Build tasks for each project, just add additional argument /t:[projectname] for each project.