Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, March 27, 2019 4:56 AM
I want to use the HID Device class in a C# project in Visual Studio
I'm trying to add the dll to the references buy right clicking the reference section in the solution explorer > Add reference, and browsing to the reference location (C:/Windows/System32/Windows.Devices.HumanInterfaceDevice.dll). I get an error asking if I have the right permissions for the file, or if its a valid COM Assembly.
How should I correctly import this dll?
All replies (2)
Wednesday, March 27, 2019 7:46 AM
Hi Bradley,
Welcome to the MSDN forum.
What's your C# project type? If it is desktop application, please follow this blog.
- Right click on References. Select “Add Reference…” from the context menu. On the left of the Reference Manager, choose Browse and find the following file: C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd. Add it to your project as a reference. Note: You will need to change the filter to “All Files”.
- Right click on References. Select “Add Reference…” from the context menu. On the left of the Reference Manager, go to Browse and find the directory “C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\NETCore\v4.5”. Add System.Runtime.WindowsRuntime.dll to your project.
After that, you can use the import this Windows.Devices.HumanInterfaceDevice as below:
Best regards,
Sara
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]
Tuesday, April 2, 2019 9:44 AM
Hi Sergio,
Have you tried my suggestion? If it not works, please feel free to let us know.
If you already solved your issue, we are welcome you share the solution or mark the helpful reply, that benefits for other community members who meet the similar issues, thank you for you understanding.
Best regards,
Sara
MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]