Assembly not referenced error with Interactive Brokes ActiveX API

Posted by Lirik on Stack Overflow See other posts from Stack Overflow or by Lirik
Published on 2010-05-11T20:55:12Z Indexed on 2010/05/11 21:24 UTC
Read the original article Hit count: 277

Filed under:
|
|
|
|

I'm attempting to use the Interactive Brokers ActiveX API, but I'm having a little trouble:

error CS0012: 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'.

My code:

namespace DataFeed.Gateway
{
    class IBGateway : IGateway
    {
        private AxTWSLib.AxTws tws; //<-- the error line
        //...
    }
}

I have a console application, so I'm wondering if that might be the reason why ActiveX is not working... or is there something else going on here? Maybe I should add the AxTWSlib.dll to the GAC, but do I really have to? If I add the dll as a resource, then I thought that I don't need to add it to the GAC.

Note: I've dropped the AxTWSlib.dll in my project folder and I've added it to the project references... no problems there.

© Stack Overflow or respective owner

Related posts about c#

Related posts about gac