Yep, that works as well. Thanks! Further context: https://github.com/dotnet/runtime/issues/40862
- rh
Process.GetCurrentProcess().MainModule?.FileName
<PublishSingleFile>true</PublishSingleFile>
), WinSCP.exe is not found even if it sits beside the published exe:
WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet (), nor the entry assembly Memphis (), nor in an installation path. You may use Session.ExecutablePath property to explicitly set path to winscp.exe.
at WinSCP.ExeSessionProcess.FindExecutable(Session session)
at WinSCP.Session.GetExecutablePath()
at WinSCP.Session.get_ExecutablePath()
at WinSCP.ExeSessionProcess.GetExecutablePath()
at WinSCP.ExeSessionProcess..ctor(Session session, Boolean useXmlLog, String additionalArguments)
at WinSCP.ExeSessionProcess.CreateForSession(Session session)
at WinSCP.Session.Open(SessionOptions sessionOptions)
AppDomain.CurrentDomain.BaseDirectory
(or AppContext.BaseDirectory
, but that is not available on net40).
session.DebugLogPath
results in an error:
System.NotSupportedException: CodeBase is not supported on assemblies loaded from a single-file bundle.
at System.Reflection.RuntimeAssembly.get_CodeBase()
at WinSCP.Logger.WriteEnvironmentInfo()
at WinSCP.Logger.SetLogPath(String value)
at WinSCP.Logger.set_LogPath(String value)
at WinSCP.Session.set_DebugLogPath(String value)