tag:help.appveyor.com,2012-11-13:/discussions/problems/1429-afterbuild-not-respected-for-webdeployAppVeyor: Discussion 2018-10-19T08:16:58Ztag:help.appveyor.com,2012-11-13:Comment/358888662015-01-27T14:45:52Z2015-01-27T14:45:52ZAfterBuild not respected for WebDeploy<div><p>Hi Johnny,</p>
<p>Have you tried the method described here: <a href=
"http://www.appveyor.com/docs/deployment/web-deploy#including-custom-files">
http://www.appveyor.com/docs/deployment/web-deploy#including-custom...</a>?</p>
<p>It worked pretty well on a few projects.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/358888662015-01-27T14:49:56Z2015-01-27T14:49:56ZAfterBuild not respected for WebDeploy<div><p>Also, we use <code>BeforeBuild</code> to publish <a href=
"http://www.appveyor.com">www.appveyor.com</a> and it works:</p>
<pre>
<code> <Target Name="BeforeBuild">
<ItemGroup>
<Content Include="site\**\*" />
</ItemGroup>
</Target></code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/358888662015-01-28T13:18:44Z2015-01-28T13:18:44ZAfterBuild not respected for WebDeploy<div><p>Thanks for the help Feodor - I'm using the first approach you
suggested and it seems to work just fine.</p>
<p>It's weird that AfterBuild doesn't work given it does when you
publish directly from Visual Studio. Most strange.</p>
<p>Unfortunately I can't use the BeforeBuild approach as that would
break the TypeScript build. (Duplicate files would collide :-(
)</p>
<p>Currently I'm ignoring the JS files built from TypeScript as
part of the build. I'm running the <code>gulp release-build</code>
task before the actual build takes place which is not quite a
reflection of how it works on my own machine. From the docs I think
I could swap to a custom build script like this:</p>
<pre>
<code># Full build of solution takes place
msbuild Proverb.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
# JavaScript files created from TypeScript are turned into build artefacts by Gulp
gulp release-build
# Everything that has been built gets packaged
msbuild Proverb.Web\Proverb.Web.csproj /t:Package /p:PackageLocation=Proverb.Web.zip</code>
</pre>
<p>Does that look about right?</p></div>johnny_reillytag:help.appveyor.com,2012-11-13:Comment/358888662015-01-28T15:50:38Z2015-01-28T15:50:38ZAfterBuild not respected for WebDeploy<div><p>Yeah, the script does look quite right to me.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/358888662015-01-28T18:04:03Z2015-01-28T18:04:03ZAfterBuild not respected for WebDeploy<div><p>Nearly there - getting this error:</p>
<p>Neither 'WebDeploy package', nor 'Web application', nor 'Zip
archive' artifact was found that can be deployed using WebDeploy
provider.</p>
<p>Do I need to place the zip in a special location perhaps?</p></div>johnny_reillytag:help.appveyor.com,2012-11-13:Comment/358888662015-01-28T18:06:17Z2015-01-28T18:06:17ZAfterBuild not respected for WebDeploy<div><p>You should configure pushing artifact: <a href=
"http://www.appveyor.com/docs/packaging-artifacts">http://www.appveyor.com/docs/packaging-artifacts</a></p>
<p>Make sure you specify "WebDeployPackage" as its type.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/358888662015-01-28T21:33:12Z2015-01-28T21:33:12ZAfterBuild not respected for WebDeploy<div><p>I think we're sorted!</p></div>johnny_reilly