HidLibrary icon indicating copy to clipboard operation
HidLibrary copied to clipboard

Operation is not supported on this platform Errors in .Net Standard 2.1 or Greater

Open youst03 opened this issue 3 years ago • 4 comments

I believe the following needs to be updated as "NETSTANDARD2_0_OR_GREATER || NET35 " to handle projects of .net standard > 2.0

#if NET20 || NET35

youst03 avatar Jan 27 '22 15:01 youst03

BeginInvoke is the "not supported operation" if you are trying to use .NET 6 - Refactor to replace it with Invoke where needed. I would be willing to do a pull request but there are 3 sitting there and I'm not sure this is a living project.

XySoftNeil avatar Jul 11 '22 23:07 XySoftNeil

I get the same error with the MonitorDeviceEvents property and the Core 3.1 framework

mmjc23 avatar Aug 08 '22 09:08 mmjc23

I have problem with hidlibrary

i create a Form windows desktop application in c#

_device.MonitorDeviceEvents=true

that command throws exception: PlatformNotSupportedException

i use MS visual studio 2022 c#, and Windows home 11, 64.bit

By console program workt all ok

radop avatar Jan 05 '23 19:01 radop

You need to change the code for this: Here it is working perfectly and faster. The code for this project needs a major cleanup. Replacing "invokes" and removing "delegates" is critical. Using TASK you don't need any of that!

    public async Task<HidReport> ReadReportAsync()
    {
        return await Task.Run(() => ReadReport());
    }

to consume it you just have to do this:

        ReportDevice = Task.Run(async () => await Device?.ReadReportAsync());

        ReportDevice.ContinueWith(t => OnReport(ReportDevice.Result));

I will upload the modifications when they are ready and clean. In my case it works perfectly with a Saitek Radio Panel for my flight simulator. (Read / Features)

greetings to all Esteban

emaiutto avatar Mar 04 '23 13:03 emaiutto