I have a .Net application that I inherited from a previous developer, which installs with no issues on all of our Development PCs, and most client site PCs ( ~ 70% or so), but which fails to install on the remaining client site PCs.
Some fail straight away, others will get further through the process before failing.
In every case, those that fail will fail with an error "Could not load file or assembly..."
Creating some Fusion logs, they are failing at different places, for example from two sites yesterday:-
Site 1 : Failed about 10 seconds into the install on UnifiedDataStructures
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.
Site 2 : Failed immediately at the start of the install on 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.
We also did a completely successful install on a client site yesterday.
All three sites were having the exact same version installed.
The working site was running Windows 11 version 22H2. The two failed sites, one was Windows 11 version 22H2, one was Windows 10 version 22H2. All were up to date with Windows Update. In all cases, we're running under an Admin user.
The installation works from an HTTPS web site. We download SETUP.EXE and run it, and then it downloads the other files and runs the setup.
I don't think the problem is at the web site end: most installs work, and on sites that fail they consistently fail, even if we try a few days later. Nor does it seem to be internet connection issues on the failing sites, everything else seems to work fine.
I don't think the problem is Anti-Virus Software either: one of the sites from yesterday used Avast, which we temporarily disabled during the installation just in case; the other site from yesterday did not have any third-party Anti-Virus Software installed.
I have a vague memory of having a similar issue about five years ago, at a different company, where a ClickOnce installer would sometimes fail because Windows was blocking some files from downloading, but I can't remember the specifics or how I solved it, and Googling for an hour didn't bring up any useful results.
As most installs work, I'm assuming that the issue is something local to the failing machines, but I'm not sure where to look next.
Usually the message
Could not load file or assembly...is related to scenario where part of you application is dependent onassemblythat is version1.1.0and some third party package is related to the sameassemblythat is version1.0.0. When that is the case - then you should create new binding redirects for application in your.configfiles. Binding redirects documentationBut in this case i think that your application is dependent on some assembly that should be already on machine where you are installing your application. And that can be a bad practice. Your installer should pack all your dependencies in
setup.exeand install them with application.Cuz you can't expect client machine to have installed exact runtime and other dependencies on their machine.
My plan would be to go through the all application dependencies and see are they part of the installer.