User16290778 posted
I create package:
msbuild myapp.csproj /T:Package /p:PublishProfile=myprofile;PackageLocation=mypackage.zip
Try to deploy:
mypackage.deploy.cmd /Y -allowUntrusted /U:user /P:pass /M:myserver -enableRule:AppOffline
-enableRule:AppOffline
is totally ignored and I get no errors. I also tried with -enableRule:AppOfflineblahblahblah
and same thing so its not even trying to validate the argument.
I want to use the script so I don't have to build a webdeploy command manually but how do I get -enableRule:AppOffline
to work?
Edit: This is the msdeploy command that it generated and ran:
msdeploy.exe -source:package='myPackage.zip' -dest:auto,computerName="myserver",userName="****",password="****",includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\....\myapp\mypackage.SetParameters.xml" -allowUntrusted -enableRule:AppOffline
So I was wrong, looks like it is adding the arg to webdeploy and webdeploy is the one ignoring it.
I know its being ignored because I see this error:
....
Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'u_extend1_x.log' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. ....