通过msdeploy部署时使用的dll grpc_csharp_ext.x64.dll

时间:2018-07-29 09:32:08

标签: gitlab-ci continuous-deployment grpc msdeploy

我正在gitlab上使用带有此args的msdeploy:

[string[]]$msdeployArgs = @(
            "-source:package='$packageFile',IncludeAcls='False'",
            "-dest:auto,ComputerName='https://$($server):8172/MsDeploy.axd?site=$($iisWebsite)',UserName='$($deployUsr)',Password='$($deployUsrPwd)',IncludeAcls='False',AuthType='Basic'",
            "-verb=sync",
            "-disableLink:AppPoolExtension",
            "-disableLink:ContentExtension",
            "-disableLink:CertificateExtension",
            "-allowUntrusted",
            "-retryAttempts=2",
            "-enableRule:AppOffline",
            "-setParam:name=""IIS Web Application Name"",value=""$iisApplicationName"""
        )

我总是有一个错误:

Info: Using ID '41f89bfc-34bd-41c2-a820-ad75f7966651' for connections to the remote server.
Info: Adding ACLs for path (test)
Info: Adding ACLs for path (test)
Info: Adding ACLs for path (test/App_Data)
Info: Using ID '33b1c88c-c667-44b0-9b2e-ffeedf0a3e0f' for connections to the remote server.
Info: Updating file (tes\App_Data\Anonymous.xml).
Info: Updating file (test\Areas\Web.config).
Info: Updating file (test\bin\grpc_csharp_ext.x64.dll).
Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'grpc_csharp_ext.x64.dll' 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.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Error count: 1.
msdeploy errorCode: -1

我该如何忽略此错误或强制部署? 问候

1 个答案:

答案 0 :(得分:1)

grpc_csharp_ext.x64.dll被IIS锁定,因此您可以选择以下方法:

  1. 在部署之前重新启动远程服务器上的IIS(您可以创建脚本来自动执行此过程,Jenkins也可以在此处提供帮助)
  2. 如果您在本地遇到此问题,则在Visual Studio中构建项目时,最简单的选择是在预构建时添加 iisreset / stop 事件,以及在构建后事件中 iisreset / start ,请参见此处:Visual Studio 2013.2 can't build because IIS is locking an assembly
  3. 将grpc降级到2.25.0(或更低版本),因为此问题与2.26.0及更高版本有关
  4. 将grpc升级到2.30.0版本,因为此版本在Grpc.Core.targets文件中实现了SkipGrpcNativeLibsCopying以解决此问题。在此处https://github.com/grpc/grpc/issues/21867和此处https://github.com/grpc/grpc/pull/22894中查看更多详细信息,但请注意此处提到的警告:https://github.com/grpc/grpc/pull/22894/commits/c6723399b8d7ed580e72220b7d880f57d1d5eae9