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

标签 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

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

最佳答案

grpc_csharp_ext.x64.dll被IIS锁定,因此这里是您的选择:

  • 部署之前,请在远程服务器上重新启动IIS(您可以创建脚本来自动执行此过程,Jenkins也可以在此处提供帮助)
  • 如果本地存在此问题,则在Visual Studio中构建项目时,最简单的选择是在预构建时添加 iisreset/stop
    事件,以及在构建后事件中 iisreset/start ,请参见此处:Visual Studio 2013.2 can't build because IIS is locking an assembly)
  • 将grpc降级到2.25.0版(或更低版本),因为此问题与2.26.0版及更高版本相关联
  • 将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
  • 关于gitlab-ci - 通过msdeploy部署时使用的dll grpc_csharp_ext.x64.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51578976/

    相关文章:

    gitlab - 如何在同一个实例中运行 Gitlab CI 作业

    ios - Jenkins:命令/usr/bin/codesign 失败,退出代码为 1

    git - 如何在不终止连接的情况下更新 docker web 应用程序?

    python - 管理不同环境的配置

    由于 package.json 包含 Windows 命令,Gitlab 管道失败

    Gitlab CI/CD 作业的日志超出限制

    kubernetes - GitLab CI/Kubernetes-为测试环境运行postgres迁移(非生产)

    protocol-buffers - grpc 和 protobuf - 当另一方未同步发布时如何处理新字段

    android - 当我尝试一起使用grpc和cordova时,程序类型已经存在com.squareup.okhttp.address

    c# - .NET 5 GRPC 客户端调用抛出异常 : Requesting HTTP version 2. 0,版本策略为 RequestVersionOrHigher,而 HTTP/2 未启用