.Net 程序有时会安装,有时会在不同地方失败

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

我有一个从以前的开发人员那里继承的 .Net 应用程序,该应用程序在我们所有的开发 PC 和大多数客户端站点 PC(约 70% 左右)上安装都没有问题,但在其余客户端站点上安装失败个人电脑。

有些会立即失败,有些会在失败之前进一步完成该过程。

在每种情况下,失败的都会失败并显示错误“无法加载文件或程序集...”

创建一些 Fusion 日志,它们在不同的地方失败,例如昨天来自两个站点:-

站点 1:在 UnifiedDataStructures

上安装大约 10 秒后失败
Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Users\User\AppData\Local\GardlinkSuite\app-4.170.312221332\GardlinkSuite.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = UnifiedDataStructures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = GardlinkSuite.exe
Calling assembly : GardlinkSuite, Version=4.170.4.1511, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\User\AppData\Local\GardlinkSuite\app-4.170.312221332\GardlinkSuite.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/UnifiedDataStructures.DLL.
LOG: Attempting download of new URL file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/UnifiedDataStructures/UnifiedDataStructures.DLL.
LOG: Attempting download of new URL file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/UnifiedDataStructures.EXE.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\User\AppData\Local\GardlinkSuite\app-4.170.312221332\UnifiedDataStructures.exe
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: UnifiedDataStructures, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
LOG: Binding succeeds. Returns assembly from C:\Users\User\AppData\Local\GardlinkSuite\app-4.170.312221332\UnifiedDataStructures.exe.
LOG: Assembly is loaded in default load context.

站点 2:在 Gardlink.Apollo.Shared.Common

上开始安装时立即失败
Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Users\User\AppData\Local\GardlinkSuite\app-4.170.312221332\GardlinkSuite.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Gardlink.Apollo.Shared.Common, Version=4.170.4.1511, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = GardlinkSuite.exe
Calling assembly : GardlinkSuite, Version=4.170.4.1511, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\User\AppData\Local\GardlinkSuite\app-4.170.312221332\GardlinkSuite.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/Gardlink.Apollo.Shared.Common.DLL.
LOG: Attempting download of new URL file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/Gardlink.Apollo.Shared.Common/Gardlink.Apollo.Shared.Common.DLL.
LOG: Attempting download of new URL file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/Gardlink.Apollo.Shared.Common.EXE.
LOG: Attempting download of new URL file:///C:/Users/User/AppData/Local/GardlinkSuite/app-4.170.312221332/Gardlink.Apollo.Shared.Common/Gardlink.Apollo.Shared.Common.EXE.
LOG: All probing URLs attempted and failed.

我们昨天还在客户端站点上完成了完全成功的安装。

所有三个站点都安装了完全相同的版本。

工作站点运行的是 Windows 11 版本 22H2。两个失败的站点,一个是Windows 11版本22H2,一个是Windows 10版本22H2。所有这些都已通过 Windows 更新进行了更新。在所有情况下,我们都在管理员用户下运行。

安装可通过 HTTPS 网站进行。我们下载 SETUP.EXE 并运行它,然后它会下载其他文件并运行安装程序。

我不认为问题出在网站端:大多数安装都可以工作,而在失败的网站上,即使我们几天后尝试,它们仍然会失败。失败的网站似乎也不是互联网连接问题,其他一切似乎都工作正常。

我也不认为问题出在防病毒软件上:昨天的一个网站使用了 Avast,我们在安装过程中暂时禁用了它,以防万一;昨天的另一个网站没有安装任何第三方防病毒软件。

我模糊地记得大约五年前,在另一家公司遇到过类似的问题,ClickOnce 安装程序有时会失败,因为 Windows 阻止某些文件下载,但我不记得具体细节或如何解决它,谷歌搜索一个小时没有得到任何有用的结果。

由于大多数安装都有效,我假设问题是故障机器本地的问题,但我不确定下一步该去哪里。

c# .net installation .net-assembly
1个回答
0
投票
通常,消息

Could not load file or assembly...

 与应用程序的一部分依赖于 
assembly
(即版本 
1.1.0
)的场景相关,并且某些第三方包与相同的 
assembly
(即版本 
1.0.0
)相关。
在这种情况下 - 那么您应该在 
.config
 文件中为应用程序创建新的绑定重定向。 
绑定重定向文档

但在这种情况下,我认为您的应用程序依赖于某些程序集,这些程序集应该已经存在于您安装应用程序的计算机上。这可能是一个不好的做法。您的安装程序应将所有依赖项打包在

setup.exe

 中,并与应用程序一起安装它们。

因为您不能期望客户端计算机在其计算机上安装了确切的运行时和其他依赖项。

我的计划是检查所有应用程序依赖项,看看它们是否是安装程序的一部分。

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