Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: Com interop issue
kramsaur
kevin.ramsaur@cotelligent.com

From: irvine, CA USA
Posts: 5
Member Since: 07/03/02
posted July 3, 2002 2:06 PM

I’ve created a .NET class that implements your .NET FTP assembly. Everything works fine when I call this.NET class from another .NET application. BUT, when I call my .NET class from a COM application, I get the following error:

 

Cannot load type Dart.PowerTCP.SegmentedStream, Dart.PowerTCP.Tcp, Version=2.0.0.1, Culture=neutral, PublicKeyToken=5966291b8955e4bb.

I've also included a licenses.licx file in my .NET class that uses PowerFTP.Net

Any idea why?

Thanks
kramsaur
kevin.ramsaur@cotelligent.com

From: irvine, CA USA
Posts: 5
Member Since: 07/03/02
posted July 3, 2002 4:28 PM

More info:

This is the method that bombs. I don't know which exact line. Must likely the Put statement.


Dim Ftp1 As New Dart.PowerTCP.Ftp()

    Ftp1.Server = mServer ' Substitute your server here.
    Ftp1.Username = mUserName ' Substitute your username here.
    Ftp1.Password = mPassword ' Substitute your password here.
    Dim ms As New MemoryStream()
    Dim sw As New StreamWriter(ms)
    sw.Write(sBody)
    sw.Flush()
    'ms.Position = 0

    Dim dir As String

    Try
      Dim sFullPath As String = mDirectory + "/" + mFileName
      Ftp1.Put(ms, sFullPath)
    Catch err As Exception
      Throw New Exception(err.Message)
      Exit Sub
    End Try
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted July 3, 2002 4:42 PM

Check the .NET project and make sure that Dart.PowerTCP.TCP.dll is added as a reference. It most likely is, since it finds it in the Common Files\Dart\DotNetDLLs directory which is in the search path defined in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders

The COM project probably can't see the DLL since it is not aware of this directory.

I think that you either need to copy both DLL's (Dart.PowerTCP.FTP and Dart.PowerTCP.TCP to the same directory where your COM app is, or register both DLL's in the GAC using gacutil:

gacutil /i <path to dll>



kramsaur
kevin.ramsaur@cotelligent.com

From: irvine, CA USA
Posts: 5
Member Since: 07/03/02
posted July 3, 2002 5:01 PM

I registered the Dart DLLs in the GAC. I now get a new error:

Attempted to call a method declared on type Dart.PowerTCP.SegmentedStream on an object which exposes Dart.PowerTCP.SegmentedStream.

Thanks
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted July 3, 2002 5:17 PM

Please create a simplified version of what you are trying to do and email it to support@dart.com. I want to make sure we are working with the exact same scenario, so I will need source code that I can compile here.

Make sure you include both the project that uses our DLL's and and project that uses the new class.

Again, please make sure that what you send is very simple and only contains what is absolutely necessary to demonstrate the problem.

Reference Forum Issue 2139 in the subject of the message.
kramsaur
kevin.ramsaur@cotelligent.com

From: irvine, CA USA
Posts: 5
Member Since: 07/03/02
posted July 5, 2002 1:47 PM

It seems that putting them in the GAC was the trick... BUT, it didn't work right away. In fact, I did a reboot, and it still didn't work after putting it in the GAC. But then, all of a sudden, it started working. As if there was some sort of cache that got unloaded.
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX