MSBuild 2017 Web Deploy Package not being created

855 views Asked by At

I'm trying to create a Web Deploy package on a new MVC application, but no matter what I try I can't create one.

I have a ProductionDeploy.pubxml file that looks like this:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>Package</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchASiteUrlAfterPublish>True</LaunchASiteUrlAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <DesktopBuildPackageLocation>C:\Packages\Project.zip</DesktopBuildPackageLocation>
    <PackageAsSingleFile>true</PackageAsSingleFile>
    <DeployIisAppPath>Default Web Site/Project</DeployIisAppPath>
    <PublishDatabaseSettings>
      <Objects xmlns="" />
    </PublishDatabaseSettings>
  </PropertyGroup>
</Project>

And if I click Publish from Visual Studio 2017, it works perfectly. If I try and run the following command, I get nothing:

msbuild Project.sln /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations /p:PackageLocation="C:\Packages\Project.zip" /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="15.0"

Same with:

msbuild Project.sln /p:DeployOnBuild=true /p:PublishProfile="ProductionDeploy"

Do I need to add anything to a brand new MVC ASP.NET web application to get MSBuild to create the deployment package?

1

There are 1 answers

0
joe_coolish On BEST ANSWER

For anyone looking, I found out my installation of Visual Studio was bad. I updated to VS2017.3 and everything started working.