tag:help.appveyor.com,2012-11-13:/discussions/problems/16213-what-might-cause-pdeployonbuildtrue-to-be-added-automatically-to-solution-buildAppVeyor: Discussion 2018-10-04T02:38:53Ztag:help.appveyor.com,2012-11-13:Comment/459900942018-08-29T22:30:34Z2018-08-29T22:30:34ZWhat might cause /p:DeployOnBuild=True to be added automatically to solution build?<div><p>To answer your most pressing question, those flags are added because you have <code>publish_wap: true</code> set in the config.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/459900942018-09-07T18:21:35Z2018-09-07T18:21:35ZWhat might cause /p:DeployOnBuild=True to be added automatically to solution build?<div><p>Thanks, and sorry for the delayed reply. What's baffling is that <code>publish_wap: true</code> did not change from my previous (working) build. Again, all that changed was the csproj formats.</p>
<p>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, <em>without</em> <code>/p:DeployOnBuild=True</code>, then build the 2 web projects and WebJob individually, <em>with</em> <code>/p:DeployOnBuild=True</code> 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, <strong>upgrading one csproj file to the new format caused AppVeyor to add <code>/p:DeployOnBuild=True</code> to the solution build and skip the individual project builds</strong>. 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 <code>/p:DeployOnBuild=True</code> out of the solution build and into individual project builds.</p>
<p>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?</p></div>tmeniertag:help.appveyor.com,2012-11-13:Comment/459900942018-09-12T01:46:48Z2018-09-12T01:46:48ZWhat might cause /p:DeployOnBuild=True to be added automatically to solution build?<div><p>Hi Todd,</p>
<p>Now it is our turn to apologize for late answer.</p>
<p><code>/p:DeployOnBuild=True</code> is being added not to actually deploy but to create a proper Web Deploy artifact (using publishing profile AppVeyor creates on-the-fly).</p>
<p>Default behavior is to add <code>/p:DeployOnBuild=True</code> to the solution if it contains at least one ASP.NET Web Application. There was an <a href="https://github.com/appveyor/ci/issues/1315">issue a while ago</a> when build failed if solution also contains Web Jobs. To fix this, we implemented a way to detected them and run <code>msbuild</code> with <code>/p:DeployOnBuild=True</code> only against Web Applications separately (behavior you used to see).</p>
<p>It seems that after your conversion to the new <code>.csproj</code> format our way of detecting Web Jobs does not work anymore.</p>
<p>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 <code>msbuild</code> command to build Web Job project as <code>after_deploy</code> script. We can help with this change (promise to answer fast :))</p>
<p>Long term, please send us converted Web Job <code>.csproj</code> to investigate. Feel free to remove all you consider sensitive from it.</p>
<p>Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/459900942018-09-13T19:36:54Z2018-09-13T19:36:54ZWhat might cause /p:DeployOnBuild=True to be added automatically to solution build?<div><p>I reverted to the old csproj format and everything's working again. Oddly enough, it's still putting <code>/p:DeployOnBuild=True</code> on the solution build.</p>
<p>Attached is approximately what it looked like with the new csproj file.</p></div>tmeniertag:help.appveyor.com,2012-11-13:Comment/459900942018-09-13T21:55:54Z2018-09-13T21:55:54ZWhat might cause /p:DeployOnBuild=True to be added automatically to solution build?<div><p>Great, thank you. Sorry for back-and-forth -- can you also send its old format version?</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/459900942018-09-14T19:14:18Z2018-09-14T19:14:32ZWhat might cause /p:DeployOnBuild=True to be added automatically to solution build?<div><p>Closed accidentally, reopening.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/459900942018-10-04T02:38:51Z2018-10-04T02:38:51ZWhat might cause /p:DeployOnBuild=True to be added automatically to solution build?<div><p>We deployed a patch so WebJob in new csproj format should not break WAP publishing scenario.</p></div>Ilya Finkelshteyn