MSBuild: $(WebPublishMethod) does not have a valid value

Viewed 3606

Im trying to publish one of our web-projects with MSBuild. When I do it directly through VS 2017 it works fine but when I run MSBuild it fails.

MS Build command:

"C:\ProgramFiles(x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild" MySolution.sln /p:DeployOnbuild=true /p:Configuration=Release /p:PublishProfile=Properties/PublishProfiles/publish.pubxml

Results in the following error

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(4359, 4): PublishProfile(publish.pubxml) is set. But the $(WebPublishMethod) does not have a valid value. Current Value is "FileSystem".

My publish.pubxml file looks like this

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>

    <WebPublishMethod>FileSystem</WebPublishMethod>
         <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
         <LastUsedPlatform>Any CPU</LastUsedPlatform>
         <SiteUrlToLaunchAfterPublish />
         <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
         <ExcludeApp_Data>False</ExcludeApp_Data>
         <publishUrl>\\1.1.1.1\c$\Site\mysite.se</publishUrl>
         <DeleteExistingFiles>True</DeleteExistingFiles>

</PropertyGroup>
</Project>

What do I do wrong?

0 Answers
Related