MissingMethodException in Session.Open error in .NET Core 2.0

Advertisement

Alberto_Valentin
Joined:
Posts:
2
Location:
NJ

MissingMethodException in Session.Open error in .NET Core 2.0

While running this C# code (.NET Core 2.0.3), the app throws System.MissingMethodException when I get to this line: session.Open(sessionOptions)
Using WinSCP 5.13.1.0
My code:
SessionOptions sessionOptions = new SessionOptions
{
  Protocol = WinSCP.Protocol.Sftp,
  HostName = "10.22.111.12",
  PortNumber = 22,
  UserName = "ec2-user", // this is on AWS.  linux EC2 instance 
  SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:..."
};
using (Session session = new Session())
{
  session.DebugLogPath = @"C:\Projects_c#\AWS\consoleApp\AMFConsoleApp\log.txt"; 
  session.Open(sessionOptions); // I get the error right here
  session.MoveFile(filePath, "10.22.111.12/appdata/content");
  session.Close();                      
}
See the log.txt attached
Description: session.DebugLogPath = @"C:\Projects_c#\AWS\consoleApp\AMFConsoleApp\log.txt";

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,440
Location:
Prague, Czechia

Re: .net core support

I'll look into it in few days. Once I have anything to test, I'll contact you.

Though note that there's no way to make the assembly working on other system than Windows.

Reply with quote

ZielinskiP
Joined:
Posts:
1
Location:
Polska

Re: .net core support

Could you please add me to acess of the developer version of WinSCP ?

I have the same problems with .NET Core 2
Method not found: 'Void System.Threading.EventWaitHandle..ctor(Boolean, System.Threading.EventResetMode, System.String, Boolean ByRef, System.Security.AccessControl.EventWaitHandleSecurity)'.
at WinSCP.ExeSessionProcess.TryCreateEvent(String name, EventWaitHandle& ev)
at WinSCP.ExeSessionProcess.InitializeConsole()
at WinSCP.ExeSessionProcess.Start()
at WinSCP.Session.Open(SessionOptions sessionOptions)

Reply with quote

Advertisement

croffers
Joined:
Posts:
1
Location:
United States

Downloaded 5.14.1 Beta still getting error

I downloaded the 5.14.1 Beta and I'm still receiving this error:
Method not found: 'Void System.Threading.EventWaitHandle..ctor(Boolean, System.Threading.EventResetMode, System.String, Boolean ByRef, System.Security.AccessControl.EventWaitHandleSecurity)'.
Was the right version of the dll included in the Beta download?

I'm using .NET Core 2.1

Thanks, Craig

Reply with quote

Pathrudu Majji
Guest

What is the solution ?

Hi Guys,

Finally what is the solution for this issue. I did not find anything from above discussion.

I had an Azure function which i am hosting in Azure. I installed WinSCP 5.13.8 from NuGet package manager. When I run this code in local, it is working fine. But this throwing above method not found error once I hosted the function and ran it from AZURE.
ERROR: System.MissingMethodException: Method not found: 'Void System.Threading.EventWaitHandle..ctor(Boolean, System.Threading.EventResetMode, System.String, Boolean ByRef, System.Security.AccessControl.EventWaitHandleSecurity)'.

Edit: Sorry for the confusion. It is not working in my local either. Do I need to add any packages? Please help me out.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum