Code Issues Getting Started with the FEZ HAT

I have just installed a FEZ HAT on my Raspberry Pi 2 running Win10 IoT Core. Also, I have downloaded the code from Bitbucket. I added the following two projects to an existing working solution and referenced in the existing project:
Shields\FEZ HAT\GHIElectronics.UAP.Shields.FEZHAT.csproj

I added the following using statement to MainPage.xaml.cs:
using GIS = GHIElectronics.UAP.Shields;
from the GHIElectronics.UAP.Examples.FEZHAT.csproj to my existing project.

in addition, I added the following to MainPage.xaml.cs:
private GIS.FEZHAT hat;
private DispatcherTimer timer;
private bool next;
private int i;
private async void Setup()
private void OnTick(object sender, object e)
from the GHIElectronics.UAP.Examples.FEZHAT.csproj to my existing project.

However I am getting comelier errors that I’m not quite sure what to do with. The first one is on this line within the Setup() method:
this.hat = await GIS.FEZHAT.CreateAsync();
the error from the line above is “The type or namespace name ‘Task’ could not be found (are you missing a using directive or an assembly reference?)”

There are many other complier errors but perhaps I’m doing something silly so I will not list them out here.

have you referenced System.Threading.Tasks?


Just tried your suggestion but no change.

@ Nicholas - have you looked at the example that came with the hat library?

Yes, that is where I started. However, when I opened the project, the solution was in a state where the ‘using System;’ statement is giving a missing a reference error. Please, see attachment.

Don’t trust the squigglies before you build at least once (and for the correct platform and flavor).

The VS editor live-checking seems to sometimes get confused - for example, there are red squigglies under ‘bool’, and it’s a safe bet that ‘bool’ is defined.

Do a clean build for the right platform (ARM if you are compiling for RPi) and then check the output log. The squigglies are a hint - not an actual compiler error.

1 Like

Thanks, I executed a Build > Clean Solution in the FEZ HAT Example project and that got rid of the squiggles of System and bool variety. When I executed a build it succeeded and in fact I was able to run the solution without issue. However, I still have a bunch of red squiggles. Strange but I’m good to go. Thanks again.