【问题标题】:intermittent failure with clickonce deployment (0x8007001F)clickonce 部署的间歇性故障 (0x8007001F)
【发布时间】:2014-09-15 10:09:30
【问题描述】:

我正在使用 clickonce 部署在业务环境 (AD) 中部署 WPF 应用程序。该应用程序是使用 Visual Studio 2013 开发的,基于 .Net 4.5。部署仅针对 Windows 7 计算机。部署服务器使用 IIS 7.5 并在 Windows Server 2008 R2 上运行。

部署被配置为应用程序在应用程序启动之前检查更新。

部署至少在大多数情况下都能正常工作,但我最近在安装应用程序更新时在几台机器上遇到了随机问题。

用户收到以下错误消息:

应用程序无法启动。联系应用程序发布者。

无法启动应用程序。请联系应用程序供应商寻求帮助。

这个错误是MSDN, Troubleshooting Specific Errors in ClickOnce Deployments中的文档

这些是应用程序时发生的一般错误消息 无法启动,也找不到其他具体原因。

我设法收集了一个涵盖此错误的日志文件:

PLATFORM VERSION INFO
Windows                       : 6.1.7601.65536 (Win32NT)
Common Language Runtime       : 4.0.30319.18444
System.Deployment.dll         : 4.0.30319.18408 built by: FX451RTMGREL
clr.dll                       : 4.0.30319.18444 built by: FX451RTMGDR
dfdll.dll                     : 4.0.30319.18408 built by: FX451RTMGREL
dfshim.dll                    : 4.0.41209.0 (Main.041209-0000)

SOURCES
    Deployment url: file:///C:/Users/ADUSERNAME/AppData/Roaming/Microsoft/Windows/Start%20Menu/Programs/Supply%20Chain%20Services%20-%20Systems%20and%20Processes/APPLICATIONNAME/APPLICATIONNAME%20Suite.appref-ms%7C
    Server: Microsoft-IIS/7.5
    X-Powered-By: ASP.NET
    Deployment Provider url: http://SERVERNAME:PORT/APPLICATIONNAME.application
    Application url: http://SERVERNAME:PORT/Application%20Files/APPLICATIONNAME_1_0_3_9/APPLICATIONNAME.exe.manifest
    Server: Microsoft-IIS/7.5
    X-Powered-By: ASP.NET

IDENTITIES
    Application Identity: APPLICATIONNAME.exe, Version=1.0.3.9, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXXXX, processorArchitecture=msil, type=win32

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\ADUSERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Supply Chain Services - Systems and Processes\APPLICATIONNAME\APPLICATIONNAME Suite.appref-ms| resulted in exception. Following failure messages were detected:
                    + A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [08/09/2014 09:25:02] : Activation of C:\Users\ADUSERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Supply Chain Services - Systems and Processes\APPLICATIONNAME\APPLICATIONNAME Suite.appref-ms| has started.
    * [08/09/2014 09:25:04] : Performing necessary update check as specified by the deployment.
    * [08/09/2014 09:25:07] : Consuming new update.
    * [08/09/2014 09:25:09] : Installation of the application has started.
    * [08/09/2014 09:25:10] : Processing of application manifest has successfully completed.
    * [08/09/2014 09:25:10] : Found compatible runtime version 4.0.30319.
    * [08/09/2014 09:25:10] : Request of trust and detection of platform is complete.
    * [08/09/2014 09:25:18] : Downloading of subscription dependencies is complete.
    * [08/09/2014 09:25:18] : Commit of the downloaded application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [08/09/2014 09:25:22] System.Runtime.InteropServices.COMException
                    - A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
                    - Source: System.Deployment
                    - Stack trace:
                                    at System.Deployment.Internal.Isolation.IStore.Transact(IntPtr cOperation, StoreTransactionOperation[] rgOperations, UInt32[] rgDispositions, Int32[] rgResults)
                                    at System.Deployment.Application.ComponentStore.SubmitStoreTransaction(StoreTransactionContext storeTxn, SubscriptionState subState)
                                    at System.Deployment.Application.ComponentStore.CommitApplication(SubscriptionState subState, CommitApplicationParams commitParams)
                                    at System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState& subState, CommitApplicationParams commitParams)
                                    at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
                                    at System.Deployment.Application.ApplicationActivator.ConsumeUpdatedDeployment(SubscriptionState& subState, ActivationDescription actDesc)
                                    at System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState& subState, String& errorPageUrl)
                                    at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& deployFile)
                                    at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
                                    at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

COMPONENT STORE TRANSACTION DETAILS
    * Transaction at [08/09/2014 09:25:22]
                    + System.Deployment.Internal.Isolation.StoreOperationStageComponent
                                    - Status: Installed
                                    - HRESULT: 0x0
                                    - Manifest: ZJHPL38T.V57.application
                    + System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata
                                    - Status: Set
                                    - HRESULT: 0x0
                    + System.Deployment.Internal.Isolation.StoreOperationStageComponent
                                    - Status: Installed
                                    - HRESULT: 0x0
                                    - Manifest: APPLICATIONNAME.exe.manifest
                    + System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
                                    - Status: Installed
                                    - HRESULT: 0x0
                                    - File: APPLICATIONNAME.exe.config
                    !!! Removed 550 Lines !!!
                    + System.Deployment.Internal.Isolation.StoreOperationInstallDeployment
                                    - Status: Installed
                                    - HRESULT: 0x0
                                    - AppId: http://SERVERNAME:PORT/APPLICATIONNAME.application#APPLICATIONNAME.application, Version=1.0.3.9, Culture=neutral, PublicKeyToken=e5b020d18338a5ca, processorArchitecture=msil
                    + System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata
                                    - Status: Set
                                    - HRESULT: 0x0
                    + System.Deployment.Internal.Isolation.StoreOperationUninstallDeployment
                                    - Status: Uninstalled
                                    - HRESULT: 0x0
                                    - AppId: http://SERVERNAME:PORT/APPLICATIONNAME.application#APPLICATIONNAME.application, Version=1.0.3.3, Culture=neutral, PublicKeyToken=e5b020d18338a5ca, processorArchitecture=msil
                    + System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata
                                    - Status: Set
                                    - HRESULT: 0x0
                    + System.Deployment.Internal.Isolation.StoreTransactionOperationType (27)
                                    - HRESULT: 0x8007001f

我还为我的测试机器激活了详细日志记录 (using this guide),但我无法重现此错误或识别导致错误的模式。

该错误仅影响 5% 到 10% 的用户,卸载和重新安装是一种解决方法,但不是解决方案。


回复 Hans Passant:

该 |确实是一个奇怪的角色,我不知道它来自哪里,也不知道它在这种情况下代表什么。然而,部署 url(包括 | 符号)始终是相同的,并且在 90% 的情况下都有效。我不认为 |符号是问题的原因。不过,我会试着找出这个角色出现的原因,然后再回来找你。

卸载/重新安装解决了客户端的问题(相同的安装程序!)。因此,我们可以排除损坏的 .Net/VS 安装。

反恶意软件 (McAfee) 可能是一个问题,一旦我设法在我的一台测试机器上重现该错误,我将立即进行调查。

文件路径长度为 123 个字符;文件名有 21 个字符。文件路径 + 文件名 = 144 个字符

【问题讨论】:

    标签: wpf deployment visual-studio-2013 clickonce


    【解决方案1】:
     ...\APPLICATIONNAME\APPLICATIONNAME Suite.appref-ms|
    

    .NET 框架通常在获得这样的文件名时会尖叫血腥谋杀。 System.IO.Path.CheckInvalidPathChars() 方法将抛出“路径中的非法字符”异常,| 字符在文件或目录名称中无效。但该检查并未在 ClickOnce 管道中执行,它不使用 FileStream 和 Path 类等普通文件处理代码。

    那个错误的文件名直接进入操作系统。接下来发生的事情是相当难以猜测的,但是文件系统会像这样翻转它肯定不会出乎意料。

    我没有合理的猜测这是如何被破坏的,这永远不会出错。一个疯狂的猜测是,鉴于此问题的频率,您周围有一台机器在 .NET Framework 或 VS 安装中有损坏的文件。可能在特定开发人员的桌面上。如果相同的安装程序在再次运行时产生良好的安装,则问题出在客户端。反恶意软件总是令人怀疑。名称很长,您可能会超出 MAX_PATH(259 个字符)并触发缓冲区溢出错误。

    只是疯狂的猜测。但这就是问题所在。祝你好运。

    【讨论】:

    • 该 |确实是个奇怪的人物,不知从何而来。
    • 您混淆了名称,删除了一条重要线索。数一数真名的字数,告诉我们有多少。
    • 144 个带空格的字符,远未达到 MAX_PATH 限制。
    • 如果您的文件名是 144 个字符,那么路径 + 文件名的长度是多少?可能超过 MaxPath 限制。
    • 文件路径长123个字符,文件名21个字符。文件路径 + 文件名 = 144 个字符
    【解决方案2】:

    当应用程序更新或安装时,这经常发生在我的点击一次部署中

    我所做的是运行以下

    rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache
    

    清除wpf缓存并再次运行url进行安装

    你可以给用户一个带有命令的bat文件,当他们遇到安装/更新问题时让他们运行它

    【讨论】:

    • 这只是解决问题的另一种方法,某种灾难恢复。但我想事先防止“灾难”。无论如何,我们的应用程序被配置为“离线”运行,因此清除 OnlineAppCache 将无效。它还会影响其他 clickonce 安装...
    • 我明白了,在为 WPF xbap 进行 clickOnce 部署时,我一直认为这是 Microsoft 错误。如果我们知道原因,那就太好了。
    • mage.exe -cc 也清除缓存。将 mage.exe 复制到客户端的计算机上就足够了。
    【解决方案3】:

    我遇到了同样的问题,我遵循的解决方案是卸载防病毒软件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-13
      • 2011-10-27
      • 1970-01-01
      • 2012-02-20
      • 1970-01-01
      • 2018-10-25
      相关资源
      最近更新 更多