Home Forums Software Development Starting service reveals error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6549
    Roman Bengl
    Participant

    Got my tobii C4 today and made a small commandline app with C# that works as planned.
    But ofcourse it only works as long as the commandlinewindow is focused, so I decided to convert it to a service.

    As soon as I want to start the service I get an error with the dependency towards the EyeXFramework:

    System.BadImageFormatException: Die Datei oder Assembly “EyeXFramework, Version=1.8.498.0, Culture=neutral, PublicKeyToken=70326046dcdce6cb” oder eine Abhängigkeit davon wurde nicht gefunden. Es wurde versucht, eine Datei mit einem falschen Format zu laden.

    I only started learning C# today and how to make services, so I don’t know what I missed. The service is compiled as x64, I use Visualstudio 2017 Community on Windows 10

    #6553
    Roman Bengl
    Participant

    OK, I got the service to run, I had to make sure all dlls and the service where compiled for the correct architecture.

    I have compiled them in x86(that’s was the first that worked)

    but now the event for the gazeStrem won’t fire. Here is the Code

    using (var lightlyFilteredGazeDataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered))
                    {
                        WriteToFile("Gazestream");
                        // Start the EyeX host.
                        try
                        {
                            eyeXHost.Start();
                        }
                        catch (Exception e)
                        {
                            WriteToFile("eyeXHost failed " + e.Message);
                        }
                        WriteToFile("EyeXHost started");
    
                        try
                        {
                            lightlyFilteredGazeDataStream.Next += (s, e) => WriteToFile("Gazestream vals: " + e.X + " - " + e.Y);
                        }
                        catch (Exception e)
                        {
                            WriteToFile("GazeDataStream " + e.Message);
                        }
                        // Let it run until a key is pressed.
    
                    }

    The WriteToFile outputs get generated, but the lightlyFilteredGazeDataStream.Next doesn’t seem to fire.

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