Our Environment:
- Windows Server 2012 R2
- IIS 8.5
- ASP.NET 5 / dnx-clr-win-x64.1.0.0-rc1-update1
- Building via Visual Studio Team Services and MSBuild to a local agent (with the following arguments /p:DeployOnBuild=true;DeployMethod=Package;PublishDNXVersion=dnx-clr-win-x64.1.0.0-rc1-update1)
- Microsoft Web Deploy 3.6 Agent
We use the Team Services Continuous Integration. Whenever someone syncs their commits, Team Services / TFS will clone a new version of the repo, run MS Build with (/p:DeployOnBuild=true;DeployMethod=Package;PublishDNXVersion=dnx-clr-win-x64.1.0.0-rc1-update1), and then call a bat file to run MSDeploy.exe to two different load balanced servers.
Roughly 85% of the time the deployment process works flawlessly. The rest of the time, the update hangs somewhere and I'm not sure where. In other words, I do not see the change someone made in Razor, the changes someone made in a CSS file, etc. On the other hand, this is what I do know:
- If I start/stop the App Pool, it picks up the newest code every time.
- If I recycle the App Pool, it picks up the newest code nearly every time.
- If I recycle the IIS instance, it works most of the time.
- The issue may occur on box 1, but not box 2. Other times, it's the opposite.
I have tried various MS Deploy options: BASE OPTION #1
@"msdeploy.exe"
-source:iisapp=%SOURCE_FOLDER%
-dest:iisapp=%DEST_IISAPP%,
computerName=%COMPUTER_NAME2%,
userName=%USERNAME%,
password=%PASSWORD%,
includeAcls='False'
-enablelink:contentlibextension
-verb:sync
Variation #1 (Start / Stop IIS Instance after Deployment):
postsync:runCommand="C:\windows\system32\inetsrv\AppCmd Stop Site %DEST_ISSAPP_NAME% & C:\windows\system32\inetsrv\AppCmd Start Site %DEST_ISSAPP_NAME%"
Variation #2 (offline):
...,appOfflineTemplate="maintenance.html" -enablerule:AppOffline
We are accustomed to resetting the Web.Config file in Asp.Net 4.5 Web Form Apps to force a recycle, but DNX seems to lock the Web.Config file and won't allow us to update it while the site is running.
Any thoughts regarding how we can best automate the recycle process while limiting downtime in production and UAT?