tag:help.appveyor.com,2012-11-13:/discussions/problems/3784-web-deploy-failsAppVeyor: Discussion 2018-10-19T08:17:39Ztag:help.appveyor.com,2012-11-13:Comment/386743442016-01-29T08:33:27Z2016-01-29T08:33:27ZWeb deploy fails<div><p>I created a github repo that reproduces this scenario. It's a
private github repo because it contains a password, but I gave you
access<br>
<a href="https://github.com/Q42/AppVeyor-Deploy-Test">https://github.com/Q42/AppVeyor-Deploy-Test</a></p>
<p>It does two deploys, one good and one bad:<br>
<a href="http://appveyor-deploy-good.azurewebsites.net">http://appveyor-deploy-good.azurewebsites.net</a><br>
<a href="http://appveyor-deploy-bad.azurewebsites.net">http://appveyor-deploy-bad.azurewebsites.net</a></p>
<p>The website shows the build number, so you can easily see which
version is active.</p>
<p>Build log is here:<br>
<a href="https://ci.appveyor.com/project/Q42/appveyor-deploy-test">https://ci.appveyor.com/project/Q42/appveyor-deploy-test</a><br>
I can't give you access to just one of our projects, but I guess
you're able to see everything anyway :)</p>
<p>Hope this works for you. Thanks!</p></div>michieltag:help.appveyor.com,2012-11-13:Comment/386743442016-01-29T15:55:30Z2016-01-29T15:55:30ZWeb deploy fails<div><p>Perfect, thank you!<br>
I will create my own azure websites and change passwords (the
second encrypted one from deploy settings won't work for me any way
as encryption is account-specific).<br>
Let you know about results.</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/386743442016-01-29T19:34:24Z2016-01-29T19:34:24ZWeb deploy fails<div><p>Very well! I've been able to reproduce the issue using
msdeploy.exe.</p>
<p>Look at the build log snippet below. Output from both
msdeploy.exe and<br>
AppVeyor is absolutely identical. As a result of this deployment
both sites<br>
were not updated. Why? AppVeyor sets <code>-useCheckSum</code> flag
by default (which<br>
I also added to msdeploy.exe command below). Using checksum makes
Web<br>
Deploy comparing files by CRC only and ignoring timestamps - this
is<br>
because when deploying from artifact (zip) or from build server all
file<br>
timestamps are always different causing to re-deploy the entire
website<br>
content instead of changed files only.</p>
<p>What makes an app "restarting" in the first place when
-usechecksum flag is<br>
disabled? Of course, updating (or "touching") web.config! With
-usechecksum<br>
flag web.config IS NOT updated, but without -usechecksum flag
web.config IS<br>
updated.</p>
<p>We don't have such an issue with classic ASP.NET apps as
re-deployment<br>
usually updates files in "bin" folder causing app to restart, but
with<br>
ASP.NET Core apps we don't have "bin" folder anymore thus the only
way to<br>
restart the app is "touching" web.config.</p>
<p>Solution?</p>
<p>For now you can just disable checksum in AppVeyor provider by
adding<br>
"do_not_use_checksum: true" to provider settings. Of course, this
will cause redeploying of nearly all files (well, for this sample
app it was 110<br>
MB of changes), but app will be restarted.</p>
<p>In the meantime we can add an option "Force restarting ASP.NET
Core app on<br>
deploy" which will be modifying web.config by appending an XML
comment to<br>
it in the form of "<!-- -->". Does that sound as a
solution?</p>
<p>"C:\Program Files (x86)\IIS\Microsoft Web Deploy
V3\msdeploy.exe"
-source:IisApp='C:\projects\appveyor-deploy-test\AppOutput\DeployTest\wwwroot'
-dest:IisApp='aspnet-webdeploy-good',ComputerName=' <a href="https://aspnet-webdeploy-good.scm.azurewebsites.net/msdeploy.axd',UserName='$aspnet-webdeploy-good',Password='AAABBBCCC',IncludeAcls='False',AuthType='Basic&#39">
https://aspnet-webdeploy-good.scm.azurewebsites.net/msdeploy.axd&#3...</a>;<br>
-verb:sync -enableLink:contentLibExtension
-enableRule:DoNotDeleteRule -useCheckSum -retryAttempts:2 Info:
Using ID '11ce8624-8bda-4dbf-a1c1-3d87aa415183' for connections
to<br>
the remote server.<br>
Info: Adding directory<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4). Info:
Adding directory<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\app).
Info: Adding directory<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\lib).
Info: Adding directory<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\lib\dnxcore50).
Info: Adding directory<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\root).
Info: Adding directory<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\root\Properties).
Info: Using ID '0a4a5cf4-3c17-4ea6-b39b-adcadc94632f' for
connections to<br>
the remote server.<br>
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\app\project.json).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\DeployTest.1.0.0-build-4.nupkg).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\DeployTest.1.0.0-build-4.nupkg.sha512).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\DeployTest.nuspec).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\lib\dnxcore50\DeployTest.dll).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\lib\dnxcore50\DeployTest.xml).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\root\hosting.json).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\root\project.json).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\root\project.lock.json).
Info: Adding file<br>
(aspnet-webdeploy-good\packages\DeployTest\1.0.0-build-4\root\Properties\launchSettings.json).
Info: Updating file (aspnet-webdeploy-good\web).<br>
Info: Updating file (aspnet-webdeploy-good\web.cmd).<br>
<em>Total changes: 18 (16 added, 0 deleted, 2 updated, 0 parameters
changed, 268603 bytes copied)</em><br>
Packaging artifacts...OK<br>
Uploading artifact AppOutput\DeployTest.zip (50.1 MB)...OK<br>
Deploying using WebDeploy provider<br>
Synchronizing contents of "DeployTest" artifact to website<br>
aspnet-webdeploy-bad on server<br>
<a href="https://aspnet-webdeploy-bad.scm.azurewebsites.net:443/msdeploy.axd">
https://aspnet-webdeploy-bad.scm.azurewebsites.net:443/msdeploy.axd</a>
using<br>
WebDeploy<br>
Synchronizing website content<br>
Info: Using ID 'd2297073-6fd2-4a8b-bd5c-d27b8683cbb4' for
connections to<br>
the remote server.<br>
Info: Adding directory<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4). Info:
Adding directory<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\app). Info:
Adding directory<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\lib). Info:
Adding directory<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\lib\dnxcore50).
Info: Adding directory<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\root).
Info: Adding directory<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\root\Properties).
Info: Using ID '8a6555c2-0c45-41b3-a2dc-ca9edcce5e5e' for
connections to<br>
the remote server.<br>
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\app\project.json).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\DeployTest.1.0.0-build-4.nupkg).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\DeployTest.1.0.0-build-4.nupkg.sha512).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\DeployTest.nuspec).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\lib\dnxcore50\DeployTest.dll).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\lib\dnxcore50\DeployTest.xml).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\root\hosting.json).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\root\project.json).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\root\project.lock.json).
Info: Adding file<br>
(aspnet-webdeploy-bad\packages\DeployTest\1.0.0-build-4\root\Properties\launchSettings.json).
Info: Updating file (aspnet-webdeploy-bad\web).<br>
Info: Updating file (aspnet-webdeploy-bad\web.cmd).<br>
<em>Total changes: 18 (16 added, 0 deleted, 2 updated, 268,603
bytes copied)</em> Deployment completed</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/386743442016-01-29T20:07:04Z2016-01-29T20:07:04ZWeb deploy fails<div><p>Thanks! Great find.</p>
<p>Just did a test and indeed it works when disabeling the
checksum. Will use that for now. Letting AppVeyor add a timestamp
to the web.config for ASP.Net 5 apps would also be a good solution
for us.</p></div>michiel