Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong FluentFTP version #1681

Open
simonepaton opened this issue Nov 15, 2024 · 6 comments
Open

Wrong FluentFTP version #1681

simonepaton opened this issue Nov 15, 2024 · 6 comments

Comments

@simonepaton
Copy link

FTP Server OS: Unix / Windows / Embedded

FTP Server Type: Vsftpd / glFTPd / BFTPd / ProFTPD / Pure-FTPd / IBM CS FTP (z/OS, OS/400) / Windows CE / Windows Server IIS / Vax / VMS / OpenVMS / Tandem / HP NonStop

Client Computer OS: Windows / Ubuntu / Debian / Linux Mint / Arch Linux

FluentFTP Version: ?

Framework: .NET 2 / 3.5 / 4 / 5 / 6 / 7 / 8 / UWP / Xamarin / Mono

<write details about your bug report / feature request here>

Logs :


Hello. I create a dll library where I use FluentFTP library. My library is integrated in a SSIS interface. When this interface calls my dll library which calls the FluentFTP I get this error: 

Error: 0x0 at Execute ftp pre operations steps, AtonAgent: 15/11/2024 13:23:01 - Eccezione generata dalla destinazione di una chiamata. - System.IO.FileNotFoundException: Non è stato possibile caricare il file o l'assembly 'FluentFTP, Version=48.0.3.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f' o una delle relative dipendenze. Impossibile trovare il file specificato.
Nome file: 'FluentFTP, Version=48.0.3.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f'
   in Utils.Ftp.FluentFtpManager.ConnectToFtp()
   in Utils.Ftp.FtpManager.ConnectToFtp() 

=== Informazioni sullo stato di preassociazione ===
REG: DisplayName = FluentFTP, Version=48.0.3.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f
 (Fully-specified)
REG: Appbase = file:///C:/Users/zzz/AppData/Local/Microsoft/Microsoft SQL Server/160/SSIS/160/x64/applocal/
REG: PrivatePath iniziale = NULL
Assembly chiamante: FluentFTP.GnuTLS, Version=1.0.31.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f.

Basically it says there is the wrong version of the FluentFTP but indeed in the packegages.config of the dll file this is the configuration:

@FanDjango
Copy link
Collaborator

Basically it says there is the wrong version of the FluentFTP

It does? Where?

but indeed in the packegages.config of the dll file this is the configuration

It is? Where?

Question:

It is not finding the assembly. Either it is not there or in the wrong place. But since I see FluentFTP.GnuTLS in there, I think that the package back-reference in FluentFTP.GnuTLS to FluentFTP for a minimum FluentFTP version of 48.0.3.0 is going wrong.

First step would be to remove usage of FluentFTP.GnuTLS entirely and to confirm that "it works", even if the subsequent connects probably fail with normal SslStream (I am assuming that you need GnuTLS for some reason like TLS1.3 etc.).

Then add FluentFTP.GnuTLS Nuget again and check what your build process is creating as a config file, continue from there. Check all the locations and the search path.

@simonepaton
Copy link
Author

simonepaton commented Nov 19, 2024

Configuration Details and Issue Description

  1. app.config File Configuration:
<dependentAssembly>
  <assemblyIdentity name="FluentFTP" publicKeyToken="f4af092b1d8df44f" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-51.1.0.0" newVersion="51.1.0.0" />
</dependentAssembly>
  1. packages.config File Configuration:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="FluentFTP" version="51.1.0" targetFramework="net481" />
  <package id="FluentFTP.GnuTLS" version="1.0.31" targetFramework="net481" />
</packages>
  1. *.csproj File Configuration:
<Reference Include="FluentFTP, Version=51.1.0.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
  <HintPath>..\packages\FluentFTP.51.1.0\lib\net472\FluentFTP.dll</HintPath>
</Reference>

Additionally, the following command was executed from the NuGet Package Manager console:
Update-Package -Reinstall

Problem Description:

The library compiled with the above configurations was referenced in a C# script within an SSIS project.
This SSIS project itself has no direct references to FluentFTP. However, when the SSIS project invokes the compiled DLL, which internally uses the FluentFTP + FluentFTP.GnuTLS libraries, an error occurs.

The error message states that it was unable to find version 48.0.3 of FluentFTP, even though the compiled library explicitly references version 51.1.0.0, as shown in the configurations above (so basically the version 48.0.3 of FluentFTP is missing as the compiled FluentFTP library is the version 51.1.0.0).

The only solution that worked was to downgrade the FluentFTP version in the compiled library to 48.0.3, instead of using version 51.1.0.0.

Question:

Could there be any hidden reason or dependency that makes this configuration specifically require version 48.0.3 of FluentFTP, even though it is not explicitly mentioned in any of the configuration files?

Also, if I create this configuration in a C# executable file, everything works so it looks like the SSIS project or script somehow needs the FluentFTP 48.0.3 version. This is weird as SSIS has only a reference to a dll library and does not have any FluentFTP library.

SSIS is running in 32 bit mode. Could this be the reason of the problem?

I added the path where my library (which references FluentFTP), FluentFTP and FluentFTP.GnuTLS are located in the Windows environment variable PATH.

Let me know if further clarification is needed!

@FanDjango
Copy link
Collaborator

Firstly:

Looks like we are talking in parallel, missing each others statements.

Can you clear up the following questions for me, and down below, I will try to address your questions.

  1. Is FluentFTP.GnuTLS involved here in any way? Yes/No
  2. If so, do you really need FluentFTP.GnuTLS? (It only allows to be included in 64bit projects)
  3. If so, FluentFTP contains back-references to FluentFTP, and it tells this in the project file as MINIMUM FluentFTP version required is 48.0.3, prior to that you could not attach FluentFTP.GnuTLS to FluentFTP (dependancy injection technique). So the error, IMO, stems from that.

Your questions in next post.

@FanDjango
Copy link
Collaborator

Could there be any hidden reason or dependency that makes this configuration specifically require version 48.0.3 of FluentFTP, even though it is not explicitly mentioned in any of the configuration files?

It is not hidden - it only appears in the project files for FluentFTP.GnuTLS, which wants to back reference a MINIMUM version of 48.0.3. And it is not "specifically" 48.0.3, it is 48.0.3 or higher.

Also, if I create this configuration in a C# executable file, everything works so it looks like the SSIS project or script somehow needs the FluentFTP 48.0.3 version. This is weird as SSIS has only a reference to a dll library and does not have any FluentFTP library.

Must be something going wrong by the interpreation of the project file syntax. I know nothing about SSIS so unless someone else chimes in here, you are more or less on your own.

SSIS is running in 32 bit mode. Could this be the reason of the problem?

Yes, it could. And also, run time fail is destined to happen because FluentFTP.GnuTLS is pure 64 bit code.

I added the path where my library (which references FluentFTP), FluentFTP and FluentFTP.GnuTLS are located in the Windows environment variable PATH.

Shaky ground, you know. FluentFTP.GnuTLS also needs to load its native binary files, and its project file tries to handle that as part of the build process.


Looks like this is still very murky.

The library compiled with the above configurations was referenced in a C# script within an SSIS project.
This SSIS project itself has no direct references to FluentFTP. However, when the SSIS project invokes the compiled DLL, which internally uses the FluentFTP + FluentFTP.GnuTLS libraries, an error occurs.

Ok, I understand that part.

Perhaps you should investigate wether your library should be provided in two versions: One for 32 bit callers without FluentFTP.GnuTLS included, and one for 64 bit users with FluentFTP.GnuTLS included.

The SSIS load of your library is interpreting the minimum 48.0.3 wrongly IMO

@simonepaton
Copy link
Author

Is FluentFTP.GnuTLS involved here in any way? Yes/No

Yes, like in the packages.config configuration the compiled dll includes and also uses it to connect to a FTPS server.

If so, do you really need FluentFTP.GnuTLS? (It only allows to be included in 64bit projects)

Yes, I really need to use FluentFTP.GnuTLS: I tried to dveelop my project without but - in that case - the FTPS server connection fails whereas it is successful if FluentFTP.GnuTLS is referenced.

If so, FluentFTP contains back-references to FluentFTP, and it tells this in the project file as MINIMUM FluentFTP version required is 48.0.3, prior to that you could not attach FluentFTP.GnuTLS to FluentFTP (dependancy injection technique). So the error, IMO, stems from that.

OK, but if the version MINIMUM is 48.0.3, I don't understand why - when used in SSIS - it requires that specific version.

@FanDjango
Copy link
Collaborator

FanDjango commented Nov 20, 2024

Microsoft SQL Server Integration Services (SSIS). Ok - I know not how they build, what that uses.

The point is that the project description files and MS's msbuild understand in terms of syntax, that a minimum version is to be enforced at that point. I wonder if that is perhaps exactly what is going wrong and if you should not research or open an issue at that place?

Referring to: this place you can see that we are asking for a minimum version.

<!-- Accepts any version 6.1 and above.
     Will resolve to the smallest acceptable stable version.-->
<PackageReference Include="ExamplePackage" Version="6.1" />

<!-- Accepts any 6.x.y version.
     Will resolve to the highest acceptable stable version.-->
<PackageReference Include="ExamplePackage" Version="6.*" />

<!-- Accepts any version above, but not including 4.1.3. Could be
     used to guarantee a dependency with a specific bug fix. 
     Will resolve to the smallest acceptable stable version.-->
<PackageReference Include="ExamplePackage" Version="(4.1.3,)" />

<!-- Accepts any version up below 5.x, which might be used to prevent pulling in a later
     version of a dependency that changed its interface. However, this form is not
     recommended because it can be difficult to determine the lowest version. 
     Will resolve to the smallest acceptable stable version.
     -->
<PackageReference Include="ExamplePackage" Version="(,5.0)" />

<!-- Accepts any 1.x or 2.x version, but not 0.x or 3.x and higher.
     Will resolve to the smallest acceptable stable version.-->
<PackageReference Include="ExamplePackage" Version="[1,3)" />

<!-- Accepts 1.3.2 up to 1.4.x, but not 1.5 and higher.
     Will resolve to the smallest acceptable stable version. -->
<PackageReference Include="ExamplePackage" Version="[1.3.2,1.5)" />

The notation is:

1.0 | x ≥ 1.0 | Minimum version, inclusive
[1.0,) | x ≥ 1.0 | Minimum version, inclusive
(1.0,) | x > 1.0 | Minimum version, exclusive
[1.0] | x == 1.0 | Exact version match
(,1.0] | x ≤ 1.0 | Maximum version, inclusive
(,1.0) | x < 1.0 | Maximum version, exclusive
[1.0,2.0] | 1.0 ≤ x ≤ 2.0 | Exact range, inclusive
(1.0,2.0) | 1.0 < x < 2.0 | Exact range, exclusive
[1.0,2.0) | 1.0 ≤ x < 2.0 | Mixed inclusive minimum and exclusive maximum version
(1.0) | invalid | invalid

I don't understand why - when used in SSIS - it requires that specific version

I don't either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants