gpt4 book ai didi

asp.net - 如何使用 -enableRule :AppOffline in deploy. cmd?

转载 作者:行者123 更新时间:2023-12-02 18:30:05 24 4
gpt4 key购买 nike

我创建包:

msbuild myapp.csproj /T:Package /p:PublishProfile=myprofile;PackageLocation=mypackage.zip

尝试部署:

mypackage.deploy.cmd /Y -allowUntrusted /U:user /P:pass /M:myserver -enableRule:AppOffline

-enableRule:AppOffline 完全被忽略,我没有收到任何错误。我还尝试了 -enableRule:AppOfflineblahblahblah 和同样的事情,所以它甚至没有尝试验证参数。

我想使用该脚本,这样我就不必手动构建 webdeploy 命令,但如何让 -enableRule:AppOffline 工作?

编辑:这是它生成并运行的 msdeploy 命令:

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

所以我错了,看起来它正在将 arg 添加到 webdeploy 中,而 webdeploy 忽略了它。

我知道它被忽略了,因为我看到了这个错误:

....
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. ....

最佳答案

你可以这样运行

"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='C:\vstsagent\A1\_work\r1\a\temp_web_package_4846182484981034.zip' -dest:auto -setParam:name='IIS Web Application Name',value='site/appname' -enableRule:AppOffline

我正在运行 .exe,而不是 .cmd 版本,后者也会调用 .exe 版本。.cmd 版本是带有预定义部署参数的命令行文件。据我在文件来源中看到的。要添加所需的参数,您必须更改生成的文件。

关于asp.net - 如何使用 -enableRule :AppOffline in deploy. cmd?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49539314/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com