我正在使用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个字符
答案 0 :(得分:2)
...\APPLICATIONNAME\APPLICATIONNAME Suite.appref-ms|
.NET Framework 通常在获取类似文件名时尖叫着血腥谋杀。 System.IO.Path.CheckInvalidPathChars()方法将抛出“路径中的非法字符”异常,|
字符在文件或目录名称中无效。但是这个检查不是在ClickOnce管道中执行的,它不使用像FileStream和Path类这样的普通文件处理代码。
那个错误的文件名直接进入操作系统。接下来发生的事情是相当不可思议的,但文件系统就像那样翻转鸟类当然不是意料之外的。
我没有理由猜测它是如何被破坏的,这绝不会出错。一个疯狂的猜测是,你有一台机器在.NET Framework或VS安装中有一个损坏的文件,考虑到这个问题的频率。可能在特定开发人员的桌面上。如果同一安装程序在再次运行时产生良好的安装,则问题是客户端。反恶意软件总是令人怀疑。这个名字很长,你可能会超过MAX_PATH(259个字符)并且会导致缓冲区溢出错误。
只是疯狂的猜测。但这就是问题所在。祝你好运。
答案 1 :(得分:0)
在应用更新或安装
时,我的点击次数经常发生我做的是运行以下
rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache
清除wpf缓存并再次运行url以安装
你可以给用户一个带有命令的bat文件,并要求他们在遇到安装/更新问题时运行它