.NET 4.0 - wodSSHTunnel assembly error (wodSSHTunnel)
Is the wodSSHTunnel library compatible with .NET 4.0 and higher? I keep getting errors when trying to create and connect to a tunnel from within a WPF application.
The sample application are written in WinForms, is there any reason these assemblies would not load in an WPF application?
.NET 4.0 - wodSSHTunnel assembly error
Hi Mike
Can you be more specific? What errors do you get?
Jasmine.
.NET 4.0 - wodSSHTunnel assembly error
It seems the sample using ActiveX winform library running on .NET version 2.0. This causes the following errors in my .NET 4.0 console project.
The type 'System.Windows.Forms.AxHost' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The Interop library does not allow the 'Copy Local' option to be set to true, so this error occurs.
Additional information: Could not load file or assembly 'Interop.wodSSHTunnelLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
When I copy the Interop.wodSSHTunnelLib.dll to the DEBUG folder in the bin directory i get the following error when running.
An unhandled exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll Additional information: ActiveX control 'a2aad48e-67e5-448e-a889-d60e7f642dbd' cannot be instantiated because the current thread is not in a single-threaded apartment.
This is all because i'm using the winforms example for the wodTunnel
new AxwodSSHTunnelLib.AxwodTunnel()
when i should be using the example tunnel found here.
wodSSHTunnelCOMLib.wodTunnelCom wodSSHTunnel1;
http://www.weonlydo.com/code.asp?did=SOCKS-proxy-over-SSH-
But I cannot find the following required tunnel library anywhere. Where would i find this assembly??
Interop.wodSSHTunnelCOMLib.dll
.NET 4.0 - wodSSHTunnel assembly error
Hi Mike.
My suggest is to use COM instead of OCX.
wodSSHTunnel comes in 3 flavors - wodTunnel.DLL (the COM object), wodTunnel.OCX (the ActiveX control), and wodTunnel.EXE (out-of-proc COM object).
I suggest you find wodTunnel.DLL instead and try with that one.
Jasmine.
.NET 4.0 - wodSSHTunnel assembly error
Ok, i will try that. I found this assembly in my Windows/System32 which was a bit hard to locate. The SSH.NET project has an assembly folder with shortcuts to all relevant DDL files. My only suggestion to have a similar folder for the SSHTunnel project.
.NET 4.0 - wodSSHTunnel assembly error
Hi Mike.
Actually it is common for COM/ActiveX to go to SYSTEM32 (SYSWOW64) since they are shared system-wide.
.NET assemblies, on the other hand, are not registered with the system and are app-specific, and as such can go to app's folder.
Jasmine.
.NET 4.0 - wodSSHTunnel assembly error
that is clear now, but it wasn't when i was going through the examples.
So i am using the COM library in a simple console .NET 4.0 application, i setup the code base as in the following example. I can run the sample WinForm ActiveX and create the tunnel, but get an error with the COM.
When i try to open the channel it will silently fail and close the console down. I was able to grab one exception below.
http://www.weonlydo.com/code.asp?did=Tunneling-HTTP-over-SSH
wodSSHTunnel1.Channels.Add(wodSSHTunnelCOMLib.ForwardTypesEnum.LocalListen, "127.0.0.1", 80, "0.0.0.0", 80);
{Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.} System.Exception {System.Runtime.InteropServices.COMException}
.NET 4.0 - wodSSHTunnel assembly error
Hi Mike.
Can you please zip your project and send it to techsupport so we can try it out?
I believe error you're getting is actual COM error returned by wodSSHTunnel, not generic "unable to use COM" kind of error. But we'd like to duplicate this to give you better answer on what could be wrong.
Jasmine.