ClickOnce部署WinForms应用无法从开始菜单启动求助
ClickOnce部署WinForms应用启动失败问题
问题描述
- 通过ClickOnce部署的WinForms应用,安装后首次启动正常,后续从开始菜单启动失败
- 可直接从本地缓存路径
C:\Users\XXXX\AppData\Local\Apps\2.0\JAX2EPR8.HG9\2D914NHW.VZQ\cmsc..tion_1c466b55ca1d742f_0001.0000_ba5046e2bd838a79中的application.exe启动应用 - 临时可通过桌面快捷方式打开该exe,但并非长期解决方案
- 应用已使用约10年,期间多次增量更新未出现问题,故障始于一周前
报错日志
PLATFORM VERSION INFO Windows : 10.0.19045.0 (Win32NT) Common Language Runtime : 4.0.30319.42000 System.Deployment.dll : 4.8.4270.0 built by: NET48REL1LAST_C clr.dll : 4.8.4645.0 built by: NET48REL1LAST_B dfdll.dll : 4.8.4270.0 built by: NET48REL1LAST_C dfshim.dll : 10.0.19041.30000 (WinBuild.160101.0800) SOURCES Deployment url : file:///C:/Users/Nicole/AppData/Roaming/Microsoft/Internet%20Explorer/Quick%20Launch/User%20Pinned/TaskBar/CMS%20Console%20Dot%20Net%204.5.appref-ms%7C ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of C:\Users\Nicole\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\CMS Console Dot Net 4.5.appref-ms| resulted in exception. Following failure messages were detected: + Downloading file:///F:/CMS Console 4.5/CMS Console Dot Net 4.5.application did not succeed. + The device is not ready. + The device is not ready. + The device is not ready. COMPONENT STORE TRANSACTION FAILURE SUMMARY No transaction error was detected. WARNINGS There were no warnings during this operation. OPERATION PROGRESS STATUS * [17/08/2023 13:44:19] : Activation of C:\Users\Nicole\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\CMS Console Dot Net 4.5.appref-ms| has started. ERROR DETAILS Following errors were detected during this operation. * [17/08/2023 13:44:19] System.Deployment.Application.DeploymentDownloadException (Unknown subtype) - Downloading file:///F:/CMS Console 4.5/CMS Console Dot Net 4.5.application did not succeed. - Source: System.Deployment - Stack trace: at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next) at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles() at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState, X509Certificate2 clientCertificate) at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation) at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation) at System.Deployment.Application.DownloadManager.DownloadDeploymentManifest(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options) at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& tempFile) at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri) at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl) at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state) --- Inner Exception --- System.Net.WebException - The device is not ready. - Source: System - Stack trace: at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next) --- Inner Exception --- System.Net.WebException - The device is not ready. - Source: System - Stack trace: at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint) at System.Net.FileWebRequest.GetResponseCallback(Object state) --- Inner Exception --- System.IO.IOException - The device is not ready. - Source: mscorlib - Stack trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async) at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint) COMPONENT STORE TRANSACTION DETAILS No transaction information is available.
问题原因
从报错日志的核心错误信息可以确定:
- ClickOnce的启动快捷方式(
.appref-ms文件)在启动时会自动检查原始部署源,尝试访问路径file:///F:/CMS Console 4.5/CMS Console Dot Net 4.5.application,但当前系统无法访问该路径对应的设备(F盘) - 具体可能的原因:
- F盘是外接存储设备(如U盘、移动硬盘),当前未连接到电脑
- F盘出现硬件故障、盘符被修改,或者系统没有读取该路径的权限
- 直接运行本地缓存的
application.exe时,会跳过ClickOnce的部署源检查流程,因此可以正常启动应用
内容的提问来源于stack exchange,提问作者willcms
相关产品推荐
相关产品推荐

