Home › Forums › Software Development › Starting service reveals error
- This topic has 1 reply, 1 voice, and was last updated 7 years, 5 months ago by Roman Bengl.
- AuthorPosts
- 21/03/2017 at 20:45 #6549Roman BenglParticipant
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
22/03/2017 at 11:46 #6553Roman BenglParticipantOK, 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.
- AuthorPosts
- You must be logged in to reply to this topic.