Could not load file or assembly

0 votes
asked Feb 13 by Prabhakar (610 points)

I get the below error message during debug

{"Could not load file or assembly 'Rebex.Networking, Version=5.0.7290.0, Culture=neutral, PublicKeyToken=1c4638788972655d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Rebex.Networking, Version=5.0.7290.0, Culture=neutral, PublicKeyToken=1c4638788972655d"}

With Fusion log enabled, the trace is

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable D:\WIP***.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = Rebex.Networking, Version=5.0.7290.0, Culture=neutral, PublicKeyToken=1c4638788972655d
(Fully-specified)
LOG: Appbase = file:///D:/WIP/***/Debug/
LOG: Initial PrivatePath = NULL

Calling assembly : Rebex.Sftp, Version=5.0.7290.0, Culture=neutral, PublicKeyToken=1c4638788972655d.

LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\WIP***.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: Post-policy reference: Rebex.Networking, Version=5.0.7290.0, Culture=neutral, PublicKeyToken=1c4638788972655d
LOG: Attempting download of new URL file:///D:/WIP/***/bin/Debug/Rebex.Networking.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Can you help me know how to fix it please ?

Applies to: Rebex SFTP

1 Answer

0 votes
answered Feb 13 by Lukas Pokorny (116,670 points)

This looks like you are executing an application linked against Rebex SFTP v5.0.7290.0 (release 2019 R4.1), but the corresponding version of Rebex.Networking (also v5.0.7290.0) is not available at run time. Please make sure that Rebex.Sftp.dll, Rebex.Networking.dll and Rebex.Common.dll are all available to your application, and that they are the same version (5.0.7290.0).

...