Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling CloseInterface() on a PIEDevice results in an exception (.NET 8.0) #1

Open
ncory-hearst opened this issue Oct 8, 2024 · 1 comment

Comments

@ncory-hearst
Copy link

When I call CloseInterface() on a PIEDevice object I've been using, I get the following exception:
System.PlatformNotSupportedException: 'Thread abort is not supported on this platform.'

Here is calling code (part of a function that cleans up after a device has been disconnected):

PIEDevice hwDevice = device.Device;
hwDevice.SetDataCallback(null);
hwDevice.SetErrorCallback(null);
hwDevice.CloseInterface();

This is using the PIEHidNetCore library within a WPF application built with .NET 8.0. I have previously used the same code, unmodified, using the PIEHid64Net library under a previous version of .NET. I recently updated my project to use .NET 8 and switched to the PIEHidNetCore library. I have not had any other issues besides this.

@michaelhatPIengineering
Copy link

I don't think closeinterface really needs to be called but not sure why it's not working...

Our PIEHidNetCore sample is written in .NET 7.0 is seems to work there.

But really we rarely use it. I think it is sort of legacy.

You could try with out and let us know about the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants