C#

Forum for C#/Windows development

C#

Postby kimarionizetha » 19 Jul 2016, 10:55

Dear everyone,
I have tried to access the C# SAMPLE program from Github, but once i try to run the code in Visual studio it gives out several error msgs. Is there anyone who has experienced the same problem? How to tackle it?
Below is one of error messages.

Severity Code Description Project File Line Suppression State
Error CS0433 The type 'ConcurrentDictionary<TKey, TValue>' exists in both 'System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' sdk_3.5 C:\Users\nizetha\Desktop\tet-csharp-client-master\tet-csharp-client-master\sdk\GazeApiManager.cs 375 Active
kimarionizetha
 
Posts: 23
Joined: 16 Dec 2014, 06:14

Re: C#

Postby Anders » 27 Jul 2016, 11:30

What version of visual studio are you using?

Have you tried to clean your solution and rebuild? That will redeploy the needed NuGet packages
Anders
 
Posts: 124
Joined: 29 Oct 2013, 16:23

Re: C#

Postby kimarionizetha » 09 Aug 2016, 05:13

I am using visual studio 2015. I have tried to rebuild the solution several times but it actually gives the same error.
kimarionizetha
 
Posts: 23
Joined: 16 Dec 2014, 06:14

Re: C#

Postby Anders » 15 Aug 2016, 11:58

I am using visual studio 2015. I have tried to rebuild the solution several times but it actually gives the same error.


The error you are getting is related to some of the NuGet packages used by the SDK. Seems they are not being properly downloaded (which is an automated process that requires internet connection).

As stated in the documentation on GitHub (under 'Building') the C# SDK project uses Visual Studio 2013, not 2015. It should support VS2015 though. My best guess is, that the differences between VS2013 and VS2015 is causing the issue you are facing.

I suggest trying the following:
1. Clean checkout of the C# SDK repo and import to VS2015. Build->Clean. Build->Rebuild.
2. Install VS2013, clean checkout of the C# SDK repo and import to VS2015. Build->Clean. Build->Rebuild.

I have double-checked that solution 2 works with my VS2013 installation.
Anders
 
Posts: 124
Joined: 29 Oct 2013, 16:23

Re: C#

Postby kimarionizetha » 02 Sep 2016, 05:23

Hi everyone, could you please assist me on this. When i run the code below it says "the "protocol" is inaccessible due to protection level". does anyone know how to make is accessible? Thanks so much. :)



using System;
using Newtonsoft.Json;

namespace EyeTribe.ClientSdk.Data
{
/// <summary>
/// Contains tracking results of a single eye.
/// </summary>
public class Eye
{
/// <summary>
/// Raw gaze coordinates in pixels
/// </summary>
[JsonProperty(PropertyName = Protocol.FRAME_RAW_COORDINATES)]
public Point2D RawCoordinates
{ get; set; }


/// <summary>
/// Smoothed gaze coordinates in pixels
/// </summary>
[JsonProperty(PropertyName = Protocol.FRAME_AVERAGE_COORDINATES)]
public Point2D SmoothedCoordinates { get; set; }

/// <summary>
/// Pupil center coordinates in normalized values
/// </summary>
[JsonProperty(PropertyName = Protocol.FRAME_EYE_PUPIL_CENTER)]
public Point2D PupilCenterCoordinates { get; set; }

/// <summary>
/// Pupil size in normalized value
/// </summary>
[JsonProperty(PropertyName = Protocol.FRAME_EYE_PUPIL_SIZE)]
public double PupilSize { get; set; }

public Eye()
{
RawCoordinates = new Point2D();
SmoothedCoordinates = new Point2D();
PupilCenterCoordinates = new Point2D();
PupilSize = 0d;
}

public Eye(Eye other)
{
if (null != other)
{
RawCoordinates = new Point2D(other.RawCoordinates);
SmoothedCoordinates = new Point2D(other.SmoothedCoordinates);
PupilCenterCoordinates = new Point2D(other.PupilCenterCoordinates);
PupilSize = other.PupilSize;
}
}

public override bool Equals(Object o)
{
if (ReferenceEquals(this, o))
return true;

if (!(o is Eye))
return false;

var other = o as Eye;

return
this.RawCoordinates.Equals(other.RawCoordinates) &&
this.SmoothedCoordinates.Equals(other.SmoothedCoordinates) &&
this.PupilCenterCoordinates.Equals(other.PupilCenterCoordinates) &&
Double.Equals(this.PupilSize, other.PupilSize);
}

public override int GetHashCode()
{
int hash = 337;
hash = hash * 797 + RawCoordinates.GetHashCode();
hash = hash * 797 + SmoothedCoordinates.GetHashCode();
hash = hash * 797 + PupilCenterCoordinates.GetHashCode();
hash = hash * 797 + PupilSize.GetHashCode();
return hash;
}
}
}
kimarionizetha
 
Posts: 23
Joined: 16 Dec 2014, 06:14

Re: C#

Postby Anders » 05 Sep 2016, 17:08

Hi everyone, could you please assist me on this. When i run the code below it says "the "protocol" is inaccessible due to protection level". does anyone know how to make is accessible? Thanks so much. :)


We are unable to help you without more knowledge of you project and setup. Please ZIP your entire project and make it available in this thread or point me to a GitHub branch holding you project.
Anders
 
Posts: 124
Joined: 29 Oct 2013, 16:23


Return to C#



cron