Home Forums .NET libraries Xceed SFTP/FTP for .NET Error when app runs on new machine

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21310 |

    I have an app that uses the FTP component that runs fine on several machines, but fails on one Win XP workstation and one Win 2003 Server.  It gets the error “Unexpected error occurred while connecting to the FTP server”.  I created a test app to reproduce the error, and did a TraceWriter (with results below the code).  Below is the test app code.  Any ideas?

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Collections;
    using Xceed.FileSystem;
    using Xceed.Ftp;

    namespace FTPS_Test
    {
        class Test
        {
            private const string XCEED_LICENSE_KEY = “abc123”;
            private FtpConnection _connection;
           
            static void Main(string[] args)
            {
                Test start = new Test();
                start.Run();
            }

            public void Run()
            {
                Connect();
                ArrayList filelist = List(“lgee\\LGEE\\EffectiveATC\\outgoing”, “ATCHourlyNF_20100706*”);
                Console.WriteLine(filelist[0].ToString());
                Console.ReadLine();
                _connection.TraceWriter.Close();
                _connection.TraceWriter = null;
                Disconnect();
            }

            public void Connect()
            {
                try
                {
                    //Set license key
                    Xceed.Ftp.Licenser.LicenseKey = XCEED_LICENSE_KEY;

                    //Make connection
                    _connection = new FtpConnection(“ftpurl”, 0, “user”, “password”, Xceed.Ftp.AuthenticationMethod.Ssl, VerificationFlags.AllFlags, null, DataChannelProtection.Private, false);
                    _connection.TraceWriter = new StreamWriter(@”d:\ftp.log”);
                    _connection.TestConnection();

                   
                }
                catch (Exception ex)
                {
                    Console.WriteLine(“Connect – ” + ex.Message);
                    throw ex;
                }
            }

            public ArrayList List(string Path, string Mask)
            {
                ArrayList filelist = new ArrayList();

                try
                {
                    FtpFolder source = new FtpFolder(_connection, Path);

                    foreach (FileSystemItem item in source.GetFiles(false, new NameFilter(Mask)))
                    {
                        filelist.Add(item.FullName);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(“List – ” + ex.Message);
                    throw ex;
                }

                return filelist;
            }

            public void Disconnect()
            {
                _connection.CloseConnections();
                _connection.Dispose();
            }
        }
    }

     

    Connected to 216.234.86.144:21 on 7/7/2010 @ 1:14:22 PM
    < 220-Microsoft FTP Service
    <     This is a restricted computer system and is the property of Open Access
    <     Technology International, Inc. It is for authorized use only. All uses
    <     of this system are logged, and the logs may be provided for use by
    <     appropriate law enforcement or regulatory agencies. Unauthorized or
    <     improper use of this system may result in immediate termination of access
    <     and notification to appropriate authorities. By continuing to use this
    <     system you indicate your awareness of and consent to these terms and
    <     conditions of use.
    < 220 LOG OFF IMMEDIATELY if you do not agree to the conditions in this notice.
    > AUTH SSL
    < 234 AUTH command ok. Expecting TLS Negotiation.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Brad (had 794 views)

    User (Old forums)
    Member
    Post count: 23064

    I found the problem.  I did not have the site’s Root CA cert installed.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Brad (had 1306 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.