ClickOnce WPF 应用程序的最新版本在一台特定计算机上的本地安装过程中拒绝激活

问题描述 投票:0回答:2

简介:
我们有3个相关的测试服务器:

   name    OS             version         .NET         CLR            

   TS1     Win7 Pro SP1   6.1.7601.65536   4.5.51209   4.0.30319.34209

   TS2     Wsrv2008r2 SP1 6.1.7601.65536   4.8.03761   4.0.30319.42000

   TS3     W11 Pro (22H2) 10.0.22621.0     4.8.09032   4.0.30319.42000

我们的应用程序套件由 Win 服务和交互式应用程序组成。后者作为 ClickOnce 包部署到 IIS。
在应用程序服务器上开始测试,并在本地下载并安装 CO 应用程序(升级以前的版本)。

我们将这两个 CO WPF 应用程序命名为 AB,后跟 1(先前版本)或 2(最新版本)。
构建 2 中对 A 和 B 的更改仅涉及 UI 行为。引用和依赖关系没有被触及,项目没有被编辑,没有新文件,没有删除。构建过程始终相同(通过脚本)。 A 和 B 本质上相似,并且引用相同的库,但有 1 个例外:A 使用

System.DirectoryServices.AccountManagement

观察结果:

  1. A2 部署到 TS3 有问题(见下文)为管理员用户本地下载和安装。
  2. 部署到 TS1 的 A2 存在完全相同的问题为管理员用户下载并安装到 TS3。
  3. 部署到 TS1 的 A2 可以在本地为管理员用户完美下载和安装。
  4. 部署到 TS3 的 A2 下载并安装在 TS1 或 TS2 上,对于管理员用户来说在本地完全正常。
  5. B1 和 B2 以您想要的任何方式下载并安装 - 从任一测试服务器到任何

A2 在 TS3 上失败激活阶段(见下文),但仅在 TS3 上。 B2 在任何测试机器上都很满意。
失败发生在用户被询问是否应安装来自未知发布者的应用程序之前(我们使用由 VisualStudio 生成的用于签署 ClickOnce 部署的自签名测试证书): PLATFORM VERSION INFO Windows : 10.0.22621.0 (Win32NT) Common Language Runtime : 4.0.30319.42000 System.Deployment.dll : 4.8.9032.0 built by: NET481REL1 clr.dll : 4.8.9139.0 built by: NET481REL1LAST_B dfdll.dll : 4.8.9032.0 built by: NET481REL1 dfshim.dll : 10.0.22621.30000 (WinBuild.160101.0800) SOURCES Deployment url : http://desktop-vtq5f2f/AppAch/client/AppAcw.application ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of http://desktop-vtq5f2f/AppAch/client/AppAcw.application resulted in exception. Following failure messages were detected: + The referenced assembly is not installed on your system. (Exception from HRESULT: 0x800736B3) COMPONENT STORE TRANSACTION FAILURE SUMMARY No transaction error was detected. WARNINGS There were no warnings during this operation. OPERATION PROGRESS STATUS * [3/1/2023 12:39:54 PM] : Activation of http://desktop-vtq5f2f/AppAch/client/AppAcw.application has started. ERROR DETAILS Following errors were detected during this operation. * [3/1/2023 12:40:03 PM] System.Runtime.InteropServices.COMException - The referenced assembly is not installed on your system. (Exception from HRESULT: 0x800736B3) - Source: System.Deployment - Stack trace: at System.Deployment.Internal.Isolation.IStore.GetAssemblyInformation(UInt32 Flags, IDefinitionIdentity DefinitionIdentity, Guid& riid) at System.Deployment.Internal.Isolation.Store.GetAssemblyManifest(UInt32 Flags, IDefinitionIdentity DefinitionIdentity) at System.Deployment.Application.ComponentStore.GetAssemblyManifestFromStore(DefinitionIdentity asmId) at System.Deployment.Application.ComponentStore.GetAssemblyManifestWithRetry(DefinitionIdentity asmId, TimeSpan retryInterval, Int32 maxRetryCount) at System.Deployment.Application.ComponentStore.GetSubscriptionStateInternal(DefinitionIdentity subId) at System.Deployment.Application.SubscriptionStore.GetSubscriptionStateInternal(SubscriptionState subState) at System.Deployment.Application.SubscriptionStore.CheckAndReferenceApplication(SubscriptionState subState, DefinitionAppId appId, Int64 transactionId) at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation) at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options) 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) COMPONENT STORE TRANSACTION DETAILS No transaction information is available.

逻辑结论是:
TS3 错了,对吧?但是

什么,以及我该如何弄清楚 我在 TS3 上搜索了System.DirectoryServices.AccountManagement.dll

C:\Windows\Microsoft.NET>dir /s System.DirectoryServices.AccountManagement.dll
Directory of C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.DirectoryServices.AccountManagement\v4.0_4.0.0.0__b77a5c561934e089
  05/06/2022  22:20  System.DirectoryServices.AccountManagement.dll  290,720 bytes
Directory of C:\Windows\Microsoft.NET\Framework\v4.0.30319
  05/06/2022  22:20  System.DirectoryServices.AccountManagement.dll  290,720 bytes
Directory of C:\Windows\Microsoft.NET\Framework64\v4.0.30319
  05/06/2022  22:20  System.DirectoryServices.AccountManagement.dll  290,720 bytes

A1 下载并安装得很好。 A2,文件夹-x复制到TS3,运行没有任何问题
.

我的结论是:TS3 上引用的库中没有丢失任何内容,因此问题必须特定于安装。 为了所有人的热爱,微软,
为什么要从日志中省略有问题的文件的名称?!

 这会很有帮助!

Windows事件日志没有任何我多次尝试的痕迹,所以它没有用。
类似错误搜索:

谷歌搜索+System.Runtime.InteropServices.COMException 0x800736B3让我看到以下内容:

answers.microsoft.com
    - 将 0x800736b3 识别为来自
  • ERROR_SXS_ASSEMBLY_NOT_FOUND
    social.msdn.microsoft.com
  • - 类似的错误描述很少细节且没有答案 - 没有用
  • 单击一次-引用的程序集未安装在您的系统上
  • - 但发布[或构建]过程没有更改,除了在其他计算机上安装相同的软件包之外,先决条件中列出了相同的文件
  • system-runtime-interopservices-comexception-when-installing-github-for-windows
  • - 可能是最好的建议,我已经知道了:清理 ClickOnce 缓存
  • 正如预期的那样,
  • rundll32 %SystemRoot%\system32\dfshim.dll CleanOnlineAppCache
删除了

C:\Users\Admin\AppData\Local\Apps\2.0

下的所有文件和大多数子文件夹。我重启了 TS3,仍然抛出错误。
mage.exe -cc
没有什么区别。
Side-by-side assembly

SxS,真是一颗宝石!

)暗示了系统中的某些内容,而不是应用程序,但是
为什么它以前从未发生过,以及为什么它影响一个应用程序而不影响另一个应用程序? 给我上色困惑!有人知道吗?我应该在哪里挖?

应该早点尝试一下,但谁知道 m$ 清理 CO 缓存的工具失败得这么惨?他们删除文件,但留下文件夹,这会以某种方式锁定后续尝试..
.net deployment clickonce windows-11
2个回答
0
投票
正如@Nemo

在接受答案的评论中提到的

,“删除

%USERPROFILE%\Local Settings\Apps\2.0内的所有文件夹的手动方法有效”。 就我而言,它是

%USERPROFILE%\AppData\Local\Apps\2.0

不需要删除整个
\2.0

文件夹,由@Erdem在

他的答案

中建议。
是的,无论哪种方式清理 ClickOnce 缓存都会删除所有 CO 应用程序

-

对于此用户

1) Rename C:\Users\{UserName}\AppData\Local\Apps\2.0 to C:\Users\{UserName}\AppData\Local\Apps\2.0A 2) Install the ClickOnce app as a new install - this will create a new C:\Users\{UserName}\AppData\Local\Apps\2.0 3) Copy all folders from C:\Users\{UserName}\AppData\Local\Apps\2.0 to C:\Users\{UserName}\AppData\Local\Apps\2.0A 4) Rename C:\Users\{UserName}\AppData\Local\Apps\2.0 to C:\Users\{UserName}\AppData\Local\Apps\2.0B 5) Rename C:\Users\{UserName}\AppData\Local\Apps\2.0A to C:\Users\{UserName}\AppData\Local\Apps\2.0

0
投票
新应用程序应安装并运行。您现有的 ClickOnce 应用程序可能会在您第一次尝试运行它们时安装/更新,但这通常不会给用户带来很大的不便。
    

© www.soinside.com 2019 - 2024. All rights reserved.