mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
120 stars 43 forks source link

The system cannot find the file specified Error #149

Closed rajithchat closed 1 year ago

rajithchat commented 1 year ago

"The system cannot find the file specified" exception is thrown when using the IQFeed.CSharpApiClient in .NET console application. Below is the code I use.

    class Program
    {
        static void Main(string[] args)
        {
            IQFeedLauncher.Start();
            var lookupClient = LookupClientFactory.CreateNew();
            lookupClient.Connect();
            var tickMessages = lookupClient.Historical.GetHistoryTickDatapointsAsync("AAPL", 100)
                .GetAwaiter().GetResult();
            foreach (var tickMessage in tickMessages)
            {
                Console.WriteLine(tickMessage.Last);
            }
            Console.ReadLine();
        }
    }

The exception is thrown when executing the IQFeedLauncher.Start(); app.config file is updated with below details. (values are included in original app.config file)

<appSettings>
    <add key="IQConnect:login" value=""/>
    <add key="IQConnect:password" value=""/>
    <add key="IQConnect:product_id" value=""/>
    <add key="IQConnect:product_version" value="6.2.0.23"/>
  </appSettings>

I tried the examples given here. This example is also throwing the same error for me.

Windows Visual Studio 2017/2019

Some help would be appreciated Thanks

BunkerCoder commented 1 year ago

@rajithchat - It looks like the iqconnect.exe file isn't in your path. It is usually installed in C:\Program Files\DTN\IQFeed. Add that to your path, and you should be good-to-go.

rajithchat commented 1 year ago

@BunkerCoder Thank you very much for the quick response. It worked. I have one thing to clarify, I saw IQFeed client is opening in the background when running the code. Does this mean we cannot use this package in Azure web jobs?

Thanks

BunkerCoder commented 1 year ago

@rajithchat - That's correct. It's not specific to IQFeedCSharpApiClient; the DTN IQFeed API (iqconnect.exe) listens for socket connections on the local loopback port. It's designed for desktop. And I think even if you could find a way to run it from a web job, it would violate the DTN license agreement.

rajithchat commented 1 year ago

@BunkerCoder Thank you very much for the information.