【问题标题】:dll grpc_csharp_ext.x64.dll in use when deploying with msdeploy使用 msdeploy 部署时使用的 dll grpc_csharp_ext.x64.dll
【发布时间】:2019-01-05 19:39:45
【问题描述】:

我在 gitlab 上使用 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

我怎样才能忽略这个错误或强制部署? 问候

【问题讨论】:

  • 我也面临同样的问题。有什么解决办法吗?

标签: gitlab-ci continuous-deployment grpc msdeploy


【解决方案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

【讨论】:

    猜你喜欢
    • 2011-06-13
    • 1970-01-01
    • 2012-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-14
    • 1970-01-01
    相关资源
    最近更新 更多