Running the Fez Hat program on local machine exception

I’m running Windows 10 Iot on rpi3 and Fez Hat. My program uses the Fez Hat but is also does a lot more and I would like to be able to debug the program locally for faster turn arounds, unit testing, away from network, etc.

The Debugger works great when target is set to ARM/Remote Machine. But debugging with Any CPU/Local Machine throws an OutOfRange exception on following line:

this.hat = await GIS.FEZHAT.CreateAsync();

Does anyone know a good way to debug locally? Is there a Fez Hat emulator? My other idea was to create an Interface and use dependency injection. Any suggestions from the experts is appreciated.

There isn’t an emulator for the FEZ Hat that I’m aware of. You could certainly create a mock if that would suit your needs.

@ pclark90 - The FEZHAT and all of our other hats use I2C, SPI, and GPIO. Those APIs are not available on the desktop and will throw exceptions. A DI mechanism is likely your best bet to enable that scenario.

Thanks for the information… I’ll try using a mock.

So difficult for me to understand. :’(