You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ClickOnce应用安装失败:MaterialDesignThemes.Wpf.dll加载清单异常求助

ClickOnce应用单机器安装失败排查求助

我翻遍了Stack Overflow上几乎所有相关错误的帖子,仍未找到问题解决方案。我们公司内部使用一款ClickOnce应用,该安装程序在多台机器上均可正常运行,但在某一位用户的机器上安装失败。考虑到其他机器都能正常安装,我怀疑这可能是权限问题或其他本地环境原因,烦请各位提供排查思路。

以下是错误日志(部分隐私内容已移除):

Windows             : 10.0.19044.0 (Win32NT)
Common Language Runtime     : 4.0.30319.42000
System.Deployment.dll       : 4.8.4270.0 built by: NET48REL1LAST_C
clr.dll             : 4.8.4515.0 built by: NET48REL1LAST_C
dfdll.dll           : 4.8.4270.0 built by: NET48REL1LAST_C
dfshim.dll          : 10.0.19041.1 (WinBuild.160101.0800)

IDENTITIES
    Deployment Identity     : Parsing Helper.application, Version=1.0.0.20, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil
    Application Identity        : Parsing Helper.exe, Version=1.0.0.20, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil, type=win32

APPLICATION SUMMARY
    * Installable application.

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of I:\..\Parsing Helper.application resulted in exception. Following failure messages were detected:
        + Exception occurred loading manifest from file MaterialDesignThemes.Wpf.dll: the manifest may not be valid or the file could not be opened. 
        + File MaterialDesignThemes.Wpf.dll is not a valid Portable Executable (PE) file.
        + PE file does not have enough data.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    * The manifest for this application does not have a signature. Signature validation will be ignored.
    * The manifest for this application does not have a signature. Signature validation will be ignored.
    * The manifest for this application does not have a signature. Signature validation will be ignored.

OPERATION PROGRESS STATUS
    * [8/18/2022 3:11:50 PM] : Activation of I:\..\Parsing Helper.application has started.
    * [8/18/2022 3:11:52 PM] : Processing of deployment manifest has successfully completed.
    * [8/18/2022 3:11:52 PM] : Installation of the application has started.
    * [8/18/2022 3:11:54 PM] : Processing of application manifest has successfully completed.
    * [8/18/2022 3:11:56 PM] : Found compatible runtime version 4.0.30319.
    * [8/18/2022 3:11:56 PM] : Request of trust and detection of platform is complete.

ERROR DETAILS
    Following errors were detected during this operation.
    * [8/18/2022 3:12:32 PM] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
        - Exception occurred loading manifest from file MaterialDesignThemes.Wpf.dll: the manifest may not be valid or the file could not be opened. 
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.Manifest.AssemblyManifest.ManifestLoadExceptionHelper(Exception exception, String filePath)
            at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
            at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
            at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
            at System.Deployment.Application.FileDownloader.OnModified()
            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.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
            at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
            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.IO.IOException
        - File MaterialDesignThemes.Wpf.dll is not a valid Portable Executable (PE) file.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.PEStream.ConstructFromFile(String filePath, Boolean partialConstruct)
            at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
        --- Inner Exception ---
        System.IO.IOException
        - PE file does not have enough data.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.PEStream.PEComponent.ReadData(FileStream file, Int64 position, Type dataType)
            at System.Deployment.Application.PEStream.ResourceDirectoryEntry..ctor(FileStream file, Int64 address)
            at System.Deployment.Application.PEStream.ResourceDirectory..ctor(ResourceSection resourceSection, FileStream file, Int64 rootResourceAddress, Int64 resourceAddress, Int64 addressDelta, Boolean partialConstruct)
            at System.Deployment.Application.PEStream.ResourceSection..ctor(FileStream file, SectionHeader sectionHeader, Boolean partialConstruct)
            at System.Deployment.Application.PEStream.ConstructPEImage(FileStream file, Boolean partialConstruct)
            at System.Deployment.Application.PEStream.ConstructFromFile(String filePath, Boolean partialConstruct)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

排查方向建议

  • 清理ClickOnce缓存:核心错误指向MaterialDesignThemes.Wpf.dll文件损坏,大概率是下载过程中文件截断。清理缓存后重新下载安装:
    1. 右键命令提示符选择「以管理员身份运行」
    2. 执行命令:rundll32 dfshim CleanOnlineAppCache
    3. 重新启动安装程序
  • 检查缓存目录权限:确认用户对ClickOnce缓存目录(C:\Users\[用户名]\AppData\Local\Apps\2.0)有完全控制权限,权限不足可能导致文件写入不完整。
  • 排查杀毒软件拦截:部分杀毒软件会扫描并修改下载的DLL文件,建议用户临时关闭杀毒软件后重试安装,完成后再恢复防护。
  • 手动验证文件完整性:对比正常机器上MaterialDesignThemes.Wpf.dll的文件大小和哈希值,让用户手动替换缓存中的对应文件,再尝试启动应用。
  • 检查.NET Framework更新:用户机器的.NET运行时为4.8,确保安装了最新的.NET 4.8补丁,缺失补丁可能导致PE文件解析异常。

内容的提问来源于stack exchange,提问作者Ethan Shoe

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.21 13:54:20