Validating PublishProfile - msbuild can't find deploy package RRS feed

  • Question

  • I was trying to publish a web api project, in Jenkins, and it failed:

    ValidatePublishProfileSettings: Validating PublishProfile(kt_ws.Public_deploypackage) settings. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4371,5): error : The value for PublishProfile is set to 'kt_ws.Public_deploypackage', expected to find the file at 'E:\Dev\Jenkins\workspace\KorTerra-Builds\KT-WS.Public-Trunk-Build\kt_ws.Public\Properties\PublishProfiles\kt_ws.Public_deploypackage' but it could not be found.

    I tried to publish using VS2019, and it worked fine.

    Then I tried running msbuild on the command line, and it failed with the same error.

    >msbuild /t:build /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=kt_ws.Public_deploypackage /p:VisualStudioVersion=14.0 /p:AspnetMergePath="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\\" test_kt_ws.Public.sln

    After spending an hour or so messing about, trying convince myself that what was happening was what was happening (and that both on the Jenkins build machine and on my local dev machine the .pubxml file was exactly where msbuild said it wasn't), I took a wild guess.

    I renamed the .pubxml file so that it didn't have a period, from "kt_ws.Public_deploypackage" to "kt_ws_Public_deploypackage".

    And then everything worked.

    Is anyone else seeing this?

    Wednesday, January 22, 2020 9:52 PM

All replies

  • Hi jeff.dege,

    Welcome to MSDN forum.

    As your description, I could reproduce this issue on my side.

    And then, I try to type the whole name with file extension like below, it could also work normally.

    msbuild D:\WebApplication1\WebApplication1\WebApplication1.csproj /p:DeployonBuild=true /p:PublishProfile=test.aa_bb1.pubxml

    So it seems that the tool confuses the file format, causing it to be incorrectly identified. When we use "." to name profile files, you need to type it with extension in command line.

    Any feedback will be expected.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Thursday, January 23, 2020 5:46 AM
  • This appears to be caused by how Microsoft.Web.Publishing.targets sets and checks the _PublishProfileExtension property. If the value of the PublishProfile property is a file name that includes a dot, then Microsoft.Web.Publishing.targets does not add the ".pubxml" extension. I think the following alternatives will work:

    • PublishProfile=kt_ws.Public_deploypackage.pubxml
    • WebPublishProfileFile=Properties\PublishProfiles\kt_ws.Public_deploypackage.pubxml
    Thursday, January 23, 2020 1:39 PM