Using the latest beta release, please set
Session.DebugLogPath
and attach the log.
Session.DebugLogPath
and attach the log.
Hi, did you manage to get winscp to work with .net5? I have the same issue
Unfortunately it doesn't work with that yet. I still get the following error message if I setPublishSingleFile=true
WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet (), nor the entry assembly Xxxxx (), nor in an installation path. You may use Session.ExecutablePath property to explicitly set path to winscp. exe.
WinSCP.exe
file.
PublishSingleFile=true
WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet (), nor the entry assembly Xxxxx (), nor in an installation path. You may use Session.ExecutablePath property to explicitly set path to winscp. exe.
ExecutablePath
. I'll test it with that as soon as possible. It would be great if you could check that again, too.
appsettings.json
(works for VS debug, publish as single file and not as single file):
private static string GetBasePath()
{
//The following code configures the application to look at the directory
//that the single-executable application was run from,
//rather than the place that the binaries were extracted to.
//
//That does not work proper:
// Environment.CurrentDirectory or AppDomain.CurrentDomain.BaseDirectory
using ProcessModule processModule = Process.GetCurrentProcess().MainModule;
return Path.GetDirectoryName(processModule?.FileName);
}
same issue to me. Will there be a new prerelease v5.18.1 on nuget.org?
May I also get a copy of the package in the meantime?
Will this fix be released to NuGet soon? May I also get a copy of the package in the meantime?
I do see it will be packaged with 5.18.1.
WinSCP.5.18.1.nupkg
.
dotnet publish -c Release -r win-x64 --output bin/publish --self-contained=true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=true
C:\temp>cdsutil -sftp -debug
Message:
CodeBase is not supported on assemblies loaded from a single-file bundle.
Type:
NotSupportedException
StackTrace:
at System.Reflection.RuntimeAssembly.get_CodeBase()
at WinSCP.Logger.DoGetAssemblyFilePath(Assembly assembly)
at WinSCP.Logger.GetAssemblyFilePath()
at WinSCP.ExeSessionProcess.GetAssemblyPath()
at WinSCP.ExeSessionProcess.GetExecutablePath()
at WinSCP.ExeSessionProcess..ctor(Session session, Boolean useXmlLog, String additionalArguments)
at WinSCP.Session.Open(SessionOptions sessionOptions)
at cdsutil.cdsSFTP.ListDirectory(String remoteDirectory)