Topic ".NET Error"

Author Message
joelignall
[View user's profile]

Joined: 2011-11-16
Posts: 9
Location: Work
Hello,

We are moving from Windows Server 2003 to Windows Server 2012. We are running the same .NET version (ver 2.0) and the same WinSCP version ver 5.0.8. The WinSCP.dll file was copied to the Microsoft.NET\Framework\<version>\ folder and the RegAsm.exe WinSCP.dll /codebase /tlb was ran successfully. However we are still getting the same error message (below) we ran before running the above steps. Any help would be greatly appreciated. Thanks!!!


System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Login.UnixServer_UserLoginAuthorization() in D:\iALPSProject\Login.aspx.vb:line 342System.InvalidOperationException: StandardIn has not been redirected. at System.Diagnostics.Process.get_StandardInput() at Login.UnixServer_UserLoginAuthorization() in D:\iALPSProject\Login.aspx.vb:line 347
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
We do not know what your UnixServer_UserLoginAuthorization is doing.

It looks like it's starting some process (wincp.exe?).
So I assume you are not using the WinSCP .NET assembly (winscp.dll).
Guest




Thank you very much, I updated the web.config file to point to "C:\Program Files (x86)\WinSCP\WinSCP.com". The application now hangs when trying to log in. Any suggestions would be appreciated. I am not a web developer so I may be missing something.
Guest




Hi Again,
We are hanging on the bit of code below. When we run the same code in windows 2003 we can see that winscp.exe and winscp.com start in the task manager and then they exit. But that does not happen in windows 2012 - we can see winscp.exe start but it’s just stuck in the task manager without exiting. It hangs at sftpProcess.WaitForExit()

Dim userOpenSessionString = "open sftp://" & oIalpsSession.UserID.ToString & ":" & oIalpsSession.Password.ToString & "@" & oIalpsSession.Machine.ToString _
& " -hostkey=" & Chr(34) & oIalpsSession.UnixSshHostKey.ToString & Chr(34)
Dim sftpProcess As Process = New Process()
Try
With sftpProcess.StartInfo
.FileName = WinSCPFileName.ToString
.UseShellExecute = False
.RedirectStandardInput = True
.RedirectStandardOutput = True
.CreateNoWindow = True
End With
Try
sftpProcess.Start()
Catch ex As Exception
Response.Write(ex.ToString)
End Try
With sftpProcess.StandardInput
.WriteLine(userOpenSessionString)
.WriteLine("exit")
.Close()
End With

sftpProcess.WaitForExit()

Dim processE(x)itCode = sftpProcess.ExitCode

If process(E)xitCode = 0 Then
sessionOpen = True
Else
sessionOpen = False
End If

Catch ex As Exception
Response.Write(ex.ToString)
sessionOpen = False
End Try

sftpProcess.Close()
sftpProcess.Dispose()

Thanks for your time, Joel
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Add /log=logpath to the WinSCP command-line and show us the log.

Or even better, use WinSCP .NET assembly instead of running WinSCP manually.
Guest




Thanks! will let our web developer know.....
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