Topic "Console crashes when started from .Net"

Author Message
Arne

Guest


I'm trying to use WinSCP, runtime, from a program I'm working on. I've already got PLink up and running and I'm going to use that for issuing commands. I'd like to use the WinSCP sychronize function for file transfer though Smile

I was able to redirect the WinSCP output stream (.Net), but the WinSCP3.com crashes when I start the process (even if I don't redirect the stream). If I just remove the .exe, I get the output stream nice and tidy as it complains it can't find the file.

I looked up the error code, and it complained about some memory conflict (I think).

I also looked at a working .com file (started fom cmd) and compared it to a crashed one (started as a process in .Net), but the only difference seemed to be that the envornment keys (not values) in the latter one were all lowercase. The .com file also crashes After it has started the WinSCP.exe process (Problem communicating with WinSCP.exe?), which seems to be working fine... It lives on as a seperate process after the WinSCP.com is terminated.

Got a clue about this? Smile

Arne
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Arne wrote:
I also looked at a working .com file (started fom cmd) and compared it to a crashed one (started as a process in .Net), but the only difference seemed to be that the envornment keys (not values) in the latter one were all lowercase.

What do you mean that you looked at a working .com file?
_________________
Martin Prikryl
Guest




prikryl wrote:
What do you mean that you looked at a working .com file?


I've started it from cmd (command prompt). Works fine then. I'm just not able to start the process from .Net. crashes with *testing*

Eception code 0xc0000005 first then again
Eception code 0xc0000005 and then
Eception code 0xc0000027.

Don't know what the exception codes stand for... Or if they're relevant at all
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Can you show me piece of code you use to run WinSCP? I do not have a .NET environment, however I can try to implement something similar in C.
_________________
Martin Prikryl
Arne

Guest


I've been writing this in VB.Net Embarassed (Not my choice):

Dim objStarupInfo As System.Diagnostics.ProcessStartInfo
objStarupInfo = New System.Diagnostics.ProcessStartInfo(System.Windows.Forms.Application.StartupPath & "WinSCP3\WinSCP3.com")
'Setting startup parameters
'Redirecting input and output streams
objStarupInfo.CreateNoWindow = True
objStarupInfo.RedirectStandardInput = True
objStarupInfo.RedirectStandardOutput = True
objStarupInfo.RedirectStandardError = True
objStarupInfo.UseShellExecute = False
objStarupInfo.WorkingDirectory = System.Windows.Forms.Application.StartupPath & "\WinSCP3"
Me.m_objSCPConsole = New Process(objStarupInfo)
Me.m_objSCPConsole.Start()
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License