Comments (23)
I just experimented with ClickOnce.
Try using LoadLibraryDllNamePrefix = "Libs\\Win64\\",
as config for FluentFTPGnuTls. It worked for me.
from fluentftp.
See #1347
Thank you for your rant.
If you know how to achieve this, please enlighten us.
from fluentftp.
See #1347
Thank you for your rant.
If you know how to achieve this, please enlighten us.
Well, based on my programming experience, programmer is the one that defines where his program is look for libraries and how his program functions, right? One example is .NET MVC which goes through series of folders searching for files and you already know that your libs are in Libs folder. Maybe NuGet package can be constructed differently, how he includes FluentFTP.dll, FluentFTP.GnuTLS.dll, maybe he can include other dlls also to be copied to bin root folder on build.
from fluentftp.
Doesn't really work that way for DllImport
. Very restricted search order. Read up on it.
So it boils down to placing the .dlls in the right folder, since you can't point to some folder of your own liking.
Which means you must have the right statements in place for MSBUILD csproj etc. to put them in the right place in different scenarios.
Teach me.
from fluentftp.
But I agree that this is an open problem, waiting to be fixed.
from fluentftp.
Maybe NuGet package can be constructed differently, how he includes FluentFTP.dll, FluentFTP.GnuTLS.dll, maybe he can include other dlls also to be copied to bin root folder on build.
Maybe NuGet package can be constructed differently, how he includes FluentFTP.dll, FluentFTP.GnuTLS.dll, maybe he can include other dlls to be copied to bin root folder on build?
from fluentftp.
Guy, too many maybe maybe for me.
from fluentftp.
Guy, too many maybe maybe for me.
I am not a programmer for this app nor I have time for it, I am giving quick suggestions of path I would take. You asked for it. :)
from fluentftp.
It was a big MSBUILD fight to get the foreign, non-managed dlls to be copied in in the first place, also trying to make sure that not too many multiple copies are kept in the Nuget, to keep it small.
Ok, thank you for the suggestion.
from fluentftp.
It was a big MSBUILD fight to get the foreign, non-managed dlls to be copied in in the first place, also trying to make sure that not too many multiple copies are kept in the Nuget, to keep it small.
Ok, thank you for the suggestion.
Another maybe:
from fluentftp.
The .dlls are already in the ClickOnce folder, but under Libs\Win64. We've done our part.
from fluentftp.
If you "publish" to a folder, nothing needs to be done as the .dlls are in the same file as the .exe
If you "publish" to click once, the .dlls go to Libs/Win64. You then need to code the config as I posted.
I think the reason for the difference is the publish to click once is trying to reconcile "portable" whereas to folder is more primitive
from fluentftp.
If you "publish" to a folder, nothing needs to be done as the .dlls are in the same file as the .exe If you "publish" to click once, the .dlls go to Libs/Win64. You then need to code the config as I posted.
I think the reason for the difference is the publish to click once is trying to reconcile "portable" whereas to folder is more primitive
Interesting is that ClickOnce knows to include NuGet pkg "main" dll, so my idea was to somehow include other dlls into NuGet that would behave the same and get picked up by ClickOnce, but maybe they can't. Possibly creating NuGet pkg for each extra dll and reference those packages into the main NuGet pkg.
from fluentftp.
I remember reading that VS, MSBUILD, .NET and NuGet like to differentiate beween managed dlls and unmanaged (foreign) dlls. So that is a real pain, the unmanaged typically don't get copied, deployed etc. without any special actions. And they get put in different places... you can't really rely on anything as it depends on the type of publish/deploy.
from fluentftp.
Just make sure you don't select "Produce Single File" on the publish settings - this somehow does not even copy the dlls, not even to the wrong place. They are simply missing. Still working on that to find out whats wrong.
from fluentftp.
While debugging it works, but when published it does not work, still can't find dlls and they are present in Libs/Win64. Again maybe because relative path gets screwed up or fluent ignores the prefix, because when I copy dlls to root of ClickOnce installed app folder, it works.
C:\Users\hrvoj\AppData\Local\Apps\2.0\GMHH1ZGH.9RW\671MP0HQ.2A5\clan...exe_0000000000000000_0001.0009_hr-hr_9a8e43760506f3df\Libs\Win64
from fluentftp.
Interesting. That picture, is exactly mine and it worked.
But I was using
client.Config.CustomStream = typeof(GnuTlsStream);
client.Config.CustomStreamConfig = new GnuConfig()
{
//SecuritySuite = GnuSuite.Normal,
//SecurityOptions = new List<GnuOption> {
// new GnuOption(GnuOperator.Include, GnuCommand.Protocol_All),
// new GnuOption(GnuOperator.Exclude, GnuCommand.Protocol_Tls10),
// new GnuOption(GnuOperator.Exclude, GnuCommand.Protocol_Tls11),
// },
//SecurityProfile = GnuProfile.None,
//AdvancedOptions = new List<GnuAdvanced> {
// GnuAdvanced.NoExtensions,
// },
SetALPNControlConnection = string.Empty,
SetALPNDataConnection = string.Empty,
//LoadLibraryDllNamePrefix = "D:\\temp\\",
LogLevel = 0,
LogMessages = GnuMessage.All,
LoadLibraryDllNamePrefix = "Libs\\Win64\\",
};
See the LoadLibraryDllNamePrefix? Thats why I did set it, because I also checked the click once install directory of my small test app.
from fluentftp.
But it still does not solve my real problem, publishing to a single executable still does not include the native dlls.
from fluentftp.
Interesting. That picture, is exactly mine and it worked.
But I was using
client.Config.CustomStream = typeof(GnuTlsStream); client.Config.CustomStreamConfig = new GnuConfig() { //SecuritySuite = GnuSuite.Normal, //SecurityOptions = new List<GnuOption> { // new GnuOption(GnuOperator.Include, GnuCommand.Protocol_All), // new GnuOption(GnuOperator.Exclude, GnuCommand.Protocol_Tls10), // new GnuOption(GnuOperator.Exclude, GnuCommand.Protocol_Tls11), // }, //SecurityProfile = GnuProfile.None, //AdvancedOptions = new List<GnuAdvanced> { // GnuAdvanced.NoExtensions, // }, SetALPNControlConnection = string.Empty, SetALPNDataConnection = string.Empty, //LoadLibraryDllNamePrefix = "D:\\temp\\", LogLevel = 0, LogMessages = GnuMessage.All, LoadLibraryDllNamePrefix = "Libs\\Win64\\", };See the LoadLibraryDllNamePrefix? Thats why I did set it, because I also checked the click once install directory of my small test app.
ClickOnce screws up, when I remove manifest file from installed folder it works, even when I return the file it still works. ClickOnce is a finicky peace of crap. Removing manifest and running the app cause something to change, then returning the manifest, it still works.
from fluentftp.
CoreCLR Version: 8.0.23.53103
.NET Version: 8.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: FluentFTP.GnuTLS.GnuTlsException: GnuTLS .dll load/call validation error
---> FluentFTP.GnuTLS.GnuTlsException: Could not load Libs\Win64\libhogweed-6.dll, (0)
at FluentFTP.GnuTLS.Core.GnuTls.FunctionLoader.Load(String dllPath, Boolean storePointer)
at FluentFTP.GnuTLS.Core.GnuTls.LoadAllFunctions()
at FluentFTP.GnuTLS.Core.GnuTls.GnuTlsCheckVersion(String reqVersion)
at FluentFTP.GnuTLS.GnuTlsInternalStream.Validate(Boolean log)
from fluentftp.
I believe you... I found out that ClickOnce when using SingleFile will use Libs/Win64/...dlls, even though they are in the apps.publish folder. When ClickOnce is not doing singlefile output, it works differently.
I have been playing around with the build process of FluentFTP.GnuTLS itself, but there is nothing there that is worth. changing.
I think the problem is with Click Once. I can't even cause it to copy the dlls using the <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
. It simply does nothing.
It is old, and then they dumped it. People protested and they brought it back for NET 5. But in GitHub DotNet there are many reports of strange behaviour and quick dirty fixes etc.
Probably I will not spend more time on this, it's crazy.
from fluentftp.
Yea, I gave up and just moved dll links to the root of the project.
from fluentftp.
@hovek It is fixed, I found a solution. Please read #1347 !
from fluentftp.
Related Issues (20)
- Process hang with GnuTLS on Linux/ARM64 HOT 9
- Upload within Parallel.ForEach() HOT 11
- Expection FluentFTP.Exceptions.FtpCommandException: Code: 550 Message: Command not recognized or allowed when use GetListing method HOT 2
- AuthenticateAsClientAsync doesn't respect ReadTimeout in a certain scenario HOT 4
- FtpException thrown downloading file with 49.0.2 works in 49.0.1 HOT 4
- Problems uploading a file into a ftp server with TLS HOT 7
- AsyncFtpClient - The operation has timed out HOT 27
- PRT and EPRT don't respect the configured proxy HOT 6
- GetObjectInfo fails for file names with spaces HOT 6
- Error on FTP UPDATFILE after sucessfull connect HOT 1
- Override Read(Span), ReadAsync(Memory), Write(ROS), WriteAsync(ROM) in streams HOT 3
- Issue with AS400 change - AfterConnect actions cannot be undone HOT 21
- Should FTP work be done with temp files? HOT 5
- GetListing Chinese garbled characters HOT 3
- Timeouts when downloading certain files HOT 2
- ftp.GetListing(path) HOT 1
- using the GetListing Error HOT 2
- FluentFTP.GnuTLS possible memory leak HOT 7
- UploadDirectory in Mirror mode occasionally deletes destination folder's entire contents HOT 5
- Allways getting Timed Out error while using Azure Funtions to connect an FTPs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentftp.