System.OverflowException in WinSCP.ConsoleCommStruct..ctor

Advertisement

zarkoh
zarkoh avatar
Joined:
Posts:
2
Location:
Oslo

System.OverflowException in WinSCP.ConsoleCommStruct..ctor

Following the C# example given at https://winscp.net/eng/docs/library#csharp

with the same standard SessionOptions configuration, I am getting the following

Error: System.OverflowException: Arithmetic operation resulted in an overflow.
at System.IntPtr.ToInt32()
at WinSCP.ConsoleCommStruct..ctor(Session session, SafeFileHandle fileMapping)
at WinSCP.ExeSessionProcess.AcquireCommStruct()
at WinSCP.ExeSessionProcess.InitializeConsole()
at WinSCP.ExeSessionProcess.Start()
at WinSCP.Session.Open(SessionOptions sessionOptions)
at ConsoleApplication1.Program.Main(String[] args) in ...\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs
:line 28

on session.Open(sessionOptions);

This basic attempt was made in a console application in VS 2012, targeting .NET 4 and using the latest dll and exe of WinSCP 5.0.7 beta.

Does anything obvious come to mind?

Reply with quote

Advertisement

zarkoh
zarkoh avatar
Joined:
Posts:
2
Location:
Oslo

Re: System.OverflowException in WinSCP.ConsoleCommStruct..ctor

Yes, using a 64-bit Windows 8 (Release Preview).

Trying on a different machine with the same OS I don't experience the issue, so it is probably some 32-bit vs. 64-bit combination of Visual Studio / solution / project target configuration that is causing the failure.

I'll report back if I manage to force it or bump into it again.

martin wrote:

I suppose you are using 64-bit OS, right?
https://learn.microsoft.com/en-us/dotnet/api/system.intptr.toint32

This bug has been added to the tracker:
https://winscp.net/tracker/869

Reply with quote

Advertisement

You can post new topics in this forum