What might cause /p:DeployOnBuild=True to be added automatically to solution build?

tmenier's Avatar

tmenier

29 Aug, 2018 08:23 PM

We recently completed some major refactoring to a solution, primarily around converting to the new csproj format, upgrading to .NET 4.7.1, and upgrading lots of NuGet packages. Our build is now failing on AppVeyor, and I've pinpointed the problem to the fact the AppVeyor has added these options to the msbuild command of sln file:

/p:DeployOnBuild=True /p:PublishProfile=appveyor
I can provide more details as needed, but for starters I'm wondering if you can tell me what might possibly cause AppVeyor to infer that I want to deploy on build? That might give me some vital clues. We are not doing it explicitly in any of our scripts, and from what I can tell nothing relevant to the build has changed other than the csproj files.

If it helps, the build is specified in yml like so:

build:
  project: MySolution.sln
  verbosity: quiet
  publish_wap: true
  parallel: true
The solution does contain 2 web apps and a WebJob, but they get deployed from different scripts. The web apps have not yet been updated to the new csproj format, but the WebJob has. Microsoft.Web.WebJobs.Publish has been upgraded from 1.0.13 to 2.0.0.

Thanks in advance.

  1. Support Staff 1 Posted by Owen McDonnell on 29 Aug, 2018 10:30 PM

    Owen McDonnell's Avatar

    To answer your most pressing question, those flags are added because you have publish_wap: true set in the config.

  2. 2 Posted by tmenier on 07 Sep, 2018 06:21 PM

    tmenier's Avatar

    Thanks, and sorry for the delayed reply. What's baffling is that publish_wap: true did not change from my previous (working) build. Again, all that changed was the csproj formats.

    But I left out a critical detail. My solution includes 2 web apps and a WebJob. When they all used the old csproj format, AppVeyor would first build the solution, without /p:DeployOnBuild=True, then build the 2 web projects and WebJob individually, with /p:DeployOnBuild=True to deploy them. The tool I used to convert to the new csproj couldn't handle the web apps, so they're still on the old format, but it upgraded the WebJob csproj. For some reason, upgrading one csproj file to the new format caused AppVeyor to add /p:DeployOnBuild=True to the solution build and skip the individual project builds. Again, there were no changes to my build configuration at all. I changed the WebJob back to the old csproj format and AppVeyor again moved /p:DeployOnBuild=True out of the solution build and into individual project builds.

    Now I'm investigating whether it failed because it couldn't find the publish profiles at the solution level. Worst case, I can stick with the old csproj format for now. But I'm curious, do you know why AppVeyor is behaving as described above?

  3. Support Staff 3 Posted by Ilya Finkelshte... on 12 Sep, 2018 01:46 AM

    Ilya Finkelshteyn's Avatar

    Hi Todd,

    Now it is our turn to apologize for late answer.

    /p:DeployOnBuild=True is being added not to actually deploy but to create a proper Web Deploy artifact (using publishing profile AppVeyor creates on-the-fly).

    Default behavior is to add /p:DeployOnBuild=True to the solution if it contains at least one ASP.NET Web Application. There was an issue a while ago when build failed if solution also contains Web Jobs. To fix this, we implemented a way to detected them and run msbuild with /p:DeployOnBuild=True only against Web Applications separately (behavior you used to see).

    It seems that after your conversion to the new .csproj format our way of detecting Web Jobs does not work anymore.

    Short term solution I see is to build them separately. You can create configurations in VS, exclude Web Job from it, set up AppVeyor to build this configuration and add msbuild command to build Web Job project as after_deploy script. We can help with this change (promise to answer fast :))

    Long term, please send us converted Web Job .csproj to investigate. Feel free to remove all you consider sensitive from it.

    Ilya.

  4. 4 Posted by tmenier on 13 Sep, 2018 07:36 PM

    tmenier's Avatar

    I reverted to the old csproj format and everything's working again. Oddly enough, it's still putting /p:DeployOnBuild=True on the solution build.

    Attached is approximately what it looked like with the new csproj file.

  5. Support Staff 5 Posted by Ilya Finkelshte... on 13 Sep, 2018 09:55 PM

    Ilya Finkelshteyn's Avatar

    Great, thank you. Sorry for back-and-forth -- can you also send its old format version?

  6. Ilya Finkelshteyn closed this discussion on 13 Sep, 2018 09:55 PM.

  7. Ilya Finkelshteyn re-opened this discussion on 14 Sep, 2018 07:14 PM

  8. Support Staff 6 Posted by Ilya Finkelshte... on 14 Sep, 2018 07:14 PM

    Ilya Finkelshteyn's Avatar

    Closed accidentally, reopening.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac