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

use*_*798 5 msdeploy continuous-deployment gitlab-ci grpc

我在带有这个参数的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"""
        )
Run Code Online (Sandbox Code Playgroud)

而且我总是有一个错误:

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
Run Code Online (Sandbox Code Playgroud)

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

Mic*_*man 3

grpc_csharp_ext.x64.dll is locked by IIS, so here are your options:

  1. Restart IIS on the remote server before deploying (you can create a script to automate this process, Jenkins can also come to aid here)
  2. If you have this issue locally, when building your project in Visual Studio - the easiest option would be to add iisreset /stop at pre-build event, and iisreset /start at the post-build event, see here: Visual Studio 2013.2 can't build because IIS is locking an assembly)
  3. Downgrade grpc to version 2.25.0 (or below), as this issue related to version 2.26.0 and up
  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