带有 MSdeploy.exe 的 WebDeploy 无法同步 GAC 程序集,因为 dll 被另一个进程锁定
我在使用 msdeploy 将 GAC 程序集同步到许多应用程序服务器时遇到此问题。
当我运行此命令时
msdeploy -verb:sync -source:gacAssembly="'MyAssembly'" -dest:gacAssembly,computername=DESTINATIONSERVER
,我收到此错误:
*Microsoft.Web.Deployment.DeploymentException: (28/09/2010 16.46.37) 在远程计算机上处理请求时发生错误。 ---> Microsoft.Web.Deployment.DeploymentClientServerException:处理“INPS.DNA.dll”时遇到错误。 ---> Microsoft.Web.Deployment.DeploymentException:错误代码为 0x80070020。 ---> System.IO.IOException:该进程无法访问“C:\ Windows \ assembly \ GAC_MSIL \ MYASSEMBLY \ 1.0.0.0__a31fe99d2f98435c \ MYASSEMBLY.dll”,因为它正在被另一个进程使用。 在 Microsoft.Web.Deployment.Win32Native.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode,字符串 MaybeFullPath) 在 Microsoft.Web.Deployment.FileStreamEx.CreateInstance(字符串路径,FileMode fileMode,FileAccess fileAccess) 在 Microsoft.Web.Deployment.FilePathProvider.Add(DeploymentObject 源,布尔值 WhatIf) --- 内部异常堆栈跟踪结束 --- --- 内部异常堆栈跟踪结束 --- 在 Microsoft.Web.Deployment.DeploymentObject.Update(DeploymentObject 源、DeploymentSyncContextsyncContext) 在 Microsoft.Web.Deployment.DeploymentSyncContext.HandleUpdate(DeploymentObject destObject,DeploymentObject sourceObject) 在 Microsoft.Web.Deployment.DeploymentSyncContext.SyncDirPathChildren(DeploymentObject destRoot,DeploymentObject sourceRoot) 在 Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest,DeploymentObject 源) 在 Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject 目标,DeploymentObject 源) 在 Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject 目标对象,DeploymentObject 源对象)
在 Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject、DeploymentSyncOptions 同步选项、PayloadTable 有效负载表、内容 tRootTable内容RootTable) 在 Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentWorkerR 请求工人请求) --- 内部异常堆栈跟踪结束 --- 在 Microsoft.Web.Deployment.StatusThreadHandler.CheckForException() 在 Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObje ct 源对象、DeploymentSyncContext 同步上下文) 在 Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject、DeploymentSyncOptions 同步选项、PayloadTable 有效负载表、内容 tRootTable内容RootTable) 在 Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions、DeploymentBaseOptions baseOptions、DeploymentSyncOptionssyncO 选项) 在 MSDeploy.MSDeploy.ExecuteWorker() 错误计数:1.*
如果我在 DESTINATIONSERVER 上执行IISRESET,则不会发生错误!
我的问题是:
是否可以在不执行 IISRESET 命令的情况下解锁 DLL?
我想我可以避免重新启动整个网络服务器。
你能帮助我吗'
非常感谢!
此致。
I'm having this problem using msdeploy to sync GAC assembly to many Application Servers.
When I run this command
msdeploy -verb:sync -source:gacAssembly="'MyAssembly'" -dest:gacAssembly,computername=DESTINATIONSERVER
I obtain this error:
*Microsoft.Web.Deployment.DeploymentException:
(28/09/2010 16.46.37) An error occurred when the request was processed on the remote computer.
---> Microsoft.Web.Deployment.DeploymentClientServerException: An error was encountered when processing 'INPS.DNA.dll'.
---> Microsoft.Web.Deployment.DeploymentException: The error code was 0x80070020.
---> System.IO.IOException: The process cannot access 'C:\Windows\assembly\GAC_MSIL\MYASSEMBLY\1.0.0.0__a31fe99d2f98435c\MYASSEMBLY.dll' because it is being used by another process.
at Microsoft.Web.Deployment.Win32Native.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
at Microsoft.Web.Deployment.FileStreamEx.CreateInstance(String path, FileMode fileMode, FileAccess fileAccess)
at Microsoft.Web.Deployment.FilePathProvider.Add(DeploymentObject source, Boolean whatIf)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Web.Deployment.DeploymentObject.Update(DeploymentObject source,DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleUpdate(DeploymentObject destObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncDirPathChildren(DeploymentObject destRoot, DeploymentObject sourceRoot)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenNoOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject
destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, Conten
tRootTable contentRootTable)
at Microsoft.Web.Deployment.DeploymentAgent.HandleSync(DeploymentAgentWorkerR
equest workerRequest)
--- End of inner exception stack trace ---
at Microsoft.Web.Deployment.StatusThreadHandler.CheckForException()
at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObje
ct sourceObject, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject
destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, Conten
tRootTable contentRootTable)
at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions
providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncO
ptions)
at MSDeploy.MSDeploy.ExecuteWorker()
Error count: 1.*
If I execute IISRESET on DESTINATIONSERVER the error doesn't occur!
My question is:
It's possible to unlock DLL without perform an IISRESET command?
I think I can avoid to restart entire Web Server.
Can you help me'
Thanks a lot!
Best regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 recycleApp 提供程序来停止和启动应用程序池怎么样?
msdeploy.exe -verb:sync -source:recycleApp -dest:recycleApp="Default Web Site",recycleMode="StopAppPool",computerName=remote-computer
...进行真正的部署...
msdeploy.exe -verb:sync -source:recycleApp -dest:recycleApp="默认网站",recycleMode="StartAppPool",computerName=remote-computer
What about using the recyleApp provider to stop and start the app pool?
msdeploy.exe -verb:sync -source:recycleApp -dest:recycleApp="Default Web Site",recycleMode="StopAppPool",computerName=remote-computer
... do your real deployment ...
msdeploy.exe -verb:sync -source:recycleApp -dest:recycleApp="Default Web Site",recycleMode="StartAppPool",computerName=remote-computer