Home › Forums › Software Development › Add Libraries to work with .NET
- This topic has 15 replies, 9 voices, and was last updated 8 years, 7 months ago by Grant [Tobii].
- AuthorPosts
- 02/10/2014 at 17:38 #1789ManuelParticipant
Hello, I am trying to create an isolated test application (not WPF) using Tobii SDK for .NET (v 0.32).
I added to my project the EyeXDotNet.sln previously builded.
I added the references EyeXFramework.dll and Tobii.Eyex.Client.Net20.dll, but, following Developers Guide I should add Tobii.Eyex.Cliente.dll and I haven’t found it (Where is? Is it completely necessary?)When I declare FormsEyeXHost singleton, this type or namespace is missing.
What is the right way to add required libraries (DLL) a Form application?
And the last thing, Are
FormsEyeXHost.Start()
andFormsEyeXHost.Init()
the same methods?Thanks in advance.
03/10/2014 at 07:47 #1792AndersParticipantHi Manuel,
yes, the Tobii.EyeX.Client dll is absolutely necessary for the eye tracking to work in your program. It’s a native dll, not a managed assembly, and therefore it’s not possible to just add it as a reference to the C# project. You can add it as content instead and have it copied to the output directory as part of the project build (“copy if newer”). You can find it in the libs/x86 directory in the SDK package.A more comprehensive post on how to set up a C# project will follow shortly, but in the mean time I hope the short summary in this thread can be useful:
Project building with several errors when using EyeXFrameworkAnd yes, the Start method used to be called Init in the earlier versions of the framework. Did we miss to change it somewhere?
03/10/2014 at 09:10 #1793ManuelParticipantThank you for the answer, now it works like a charm!
About Init() or Start() method, In my current EyeXFramework dll, only Start() method appears (in Developer’s Guide, Init() method appears instead of it).
03/10/2014 at 09:57 #1795AndersParticipantOk, thanks, we’ll fix that for the next release!
08/10/2014 at 00:18 #1814DwayneParticipantHi Anders,
Has themore comprehensive post on how to set up a C# project
been posted or is it still in the works?
Like others, I am running into a lot of issues with the SDK WPF sample and attempts at new barebones WPF projects where Visual Studio 2013 and Blend 2013 are complaining about Tobii.EyeX.Client.Net20.
Trying to keep things simple, I have chosen to follow along by building the sample project to generate x86 versions of:
– EyeXFramework.dll
– Tobii.EyeX.Client.Net20.dll
that are output to the EyeXFramework\bin\x86\Debug folder
and including the x86 version of Tobii.EyeX.Client.dll from the lib\x86 folderHowever, even though the sample app will run it still shows the following four errors if I open MainWindow.xaml in VS 2013:
Error 1 Could not load file or assembly ‘Tobii.EyeX.Client.Net20, Version=0.32.384.0, Culture=neutral, PublicKeyToken=70326046dcdce6cb’ or one of its dependencies. The system cannot find the file specified. …\DNetEyeXSDK\TobiiEyeXSdk-DotNet-0.32.384\source\WpfSamples\GazeAwareElements\MainWindow.xaml 63 9 GazeAwareElements
Error 2 Could not load file or assembly ‘Tobii.EyeX.Client.Net20, Version=0.32.384.0, Culture=neutral, PublicKeyToken=70326046dcdce6cb’ or one of its dependencies. The system cannot find the file specified. …\DNetEyeXSDK\TobiiEyeXSdk-DotNet-0.32.384\source\WpfSamples\GazeAwareElements\MainWindow.xaml 72 9 GazeAwareElements
Error 3 Could not load file or assembly ‘Tobii.EyeX.Client.Net20, Version=0.32.384.0, Culture=neutral, PublicKeyToken=70326046dcdce6cb’ or one of its dependencies. The system cannot find the file specified. …\DNetEyeXSDK\TobiiEyeXSdk-DotNet-0.32.384\source\WpfSamples\GazeAwareElements\MainWindow.xaml 81 9 GazeAwareElements
Error 4 Could not load file or assembly ‘Tobii.EyeX.Client.Net20, Version=0.32.384.0, Culture=neutral, PublicKeyToken=70326046dcdce6cb’ or one of its dependencies. The system cannot find the file specified. …\DNetEyeXSDK\TobiiEyeXSdk-DotNet-0.32.384\source\WpfSamples\GazeAwareElements\MainWindow.xaml 95 9 GazeAwareElementsAnd in a barebones new project the following error appears if I try to add the sample code described in the first two steps on pages 11 and 12 of the Developers guide:
Error 1 Could not load file or assembly ‘Tobii.EyeX.Client.Net20, Version=0.32.384.0, Culture=neutral, PublicKeyToken=70326046dcdce6cb’ or one of its dependencies. The system cannot find the file specified. …\TobiiTest\TobiiTest\MainWindow.xaml 7 13 TobiiTest
Besides checking and double checking that the configuration manager is set to x86, I have also attempted a reboot to make sure that previous attempted builds or experiments have not left another version in memory.
What other kinds of things would cause either a mismatch or load failure of Tobii.EyeX.Client.Net20.dll
Should the x86 versions of these dll’s also work in Blend 2013?
Thanks.
08/10/2014 at 12:28 #1822Jenny [Tobii]ParticipantHi Dwayne,
Sorry to hear you are having problems getting things to work.
Could it be that you do not have the .NET 2.0 Framework installed on your system? Could happen if you are on Windows 8 and never installed any previous version of Visual Studio.
Go to Control Panel -> Programs, and then choose the Turn Windows features on or off link.
Make sure that the .NET Framework 3.5 (includes .NET 2.0 and 3.0) check box is selected.
You don’t need to select the check boxes for any child nodes for optional components of the .NET Framework.The post about how to set up a C# project is still pending on our todo-list.
/Jenny
08/10/2014 at 18:24 #1825DwayneParticipantHi Jenny,
Thanks for the suggestion, but that does not seem to be the issue.
.Net Framework 3.5 does show up as installed and selected.
This is a Windows 8 machine, but Visual Studio 2012 was previously installed on it.13/10/2014 at 14:49 #1835Robert [Tobii]ParticipantHi,
It seems like the standard security settings for Visual Studio 2013 is too restrictive for the EyeX.Client.Net20 dll, probably because the default settings in VS2013 are adapted for the Windows 8 sandbox.
I did like this to make it work in VS2013 (haven’t tried with Blend, but it should be equivalent)
- Right-click on the Solution in the Solution explorer
- Choose “Properties”
- Navigate to Common Properties –> Code Analysis Settings
- Change the “Rule set” to “Microsoft Managed Minimum Rules”
You can also use the <loadFromRemoteSources> element in app.config. Please refer to MSDN.
15/10/2014 at 13:10 #1850Jenny [Tobii]ParticipantHi again Dwayne,
I was able to easily reproduce the problem on my machine when I downloaded the EyeX SDK for .NET and then created a new WPF application in Visual Studio 2013.
The security settings fix proposed by Robert above did not solve the issue for me. But I did manage to find out what the problem was: the dll’s became blocked by the Windows 8 operating system since they were downloaded from the internet.
Before going into how to resolve the issue, I suggest one change to how you are referencing the dll’s. Instead of referencing the Tobii.EyeX.Client.Net20.dll from the EyeXFramework\bin\x86\Debug folder, which could be considered a temporary output folder, I suggest you copy the .Net20 dll to the lib\x86 folder, next to the othe client dll, where you can be sure it stays. Also, for the Tobii.EyeX.Client.dll make sure to change its properties so that “Copy to Output Directory” is set to “Copy if newer”. This way, your project will be set up so that you can easily replace the two Tobii EyeX Client dll’s with newer versions in a single location, and have the project reference the correct versions.
Now, how to solve the .Net20 dll not found issue:
– Open File Explorer and locate the dll files that you are referencing in your project (..\lib\x86)
– For each file: Right click the file name, and open “Properties”,
– On the bottom of the “General” tab you will find a button “Unblock”,
– Click this button to unblock the file
– In VS 2013, rebuild the whole solution,
– And the error message should be gone/Jenny
15/10/2014 at 18:23 #1855DwayneParticipantHi Jenny,
Yes, I tried Robert’s suggestion yesterday and it didn’t work for me either.
However, I just tried your fix, and it did the trick.
Thank you so much!
24/11/2015 at 01:41 #3810Pei GuoParticipantJenny’s solution works well for me.
My problem was in GazeAwareElements project, the MainWindow.xaml displayed “could not load file or assembly: ‘Tobii.EyeX.Client.Net20…” I am On Windows 10 with VS 2013.
Thanks Jenny!
26/11/2015 at 12:56 #3830Jenny [Tobii]ParticipantHi Pei,
Is this with an “out-of-the-box” version of the EyeX SDK, when you have opened the EyeXDotNet.sln file with VS 2013? Do all the other projects work as expected?
Could you try and remove and re-add the reference to the Tobii.EyeX.Client.Net20.dll for the GazeAwareElements project? (Set it up the same as for the ActivatableElements project)
25/03/2016 at 12:14 #4902yagoubParticipantHi Jenny
thank’s it work’s well For me ,,,, Merci شكرا
25/03/2016 at 14:17 #4903yagoubParticipanthi , i have Problem
in GazeAwareElements Tobii sample the Text don’t change Foreground when i look in ,,,
i make Red to be more visible some resalt is it normal ,,, i didn’t like a new sdk of tobii
<Style x:Key=”EyeXGazeAwareText” BasedOn=”{StaticResource EyeXGazeAwareElement}” TargetType=”TextBlock”>
<Setter Property=”Foreground” Value=”Red” /> <!– Value=”DimGray”–>
<Style.Triggers>
<Trigger Property=”eyeX:Behavior.HasGaze” Value=”True”>
<Setter Property=”Foreground” Value=”Black” />
</Trigger>
</Style.Triggers>
</Style>04/05/2016 at 05:46 #5144emabiParticipantHello all, i have a problem adding libraries to work with dot net.
I have a simple window form game , i want to add this MinimalGazeDataStream in my windows form as a base to find eye positions and print them to the console over a period of time, i followed the dev guide but it is not working . i am getting red on the using statement.
can you help.
Regards Emanuel - AuthorPosts
- You must be logged in to reply to this topic.