C# Blazor injecting .net framework dll

Roman Gelfand 21 Reputation points
2022-12-28T03:57:50.85+00:00

I have a .net framework .dll which captures raw input. It utilizes win32 c classes. The main use of this dll is to determin a) what key was pressed b) what device id was used to press the key.

Can I inject this dll into a web blazor component written in c# for the purpose of determining 1) what key was entered 2) from which device?

Thanks in advance

Developer technologies .NET Blazor
Developer technologies C#
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2022-12-28T17:08:07.753+00:00

    Only a blazor server app can call win32 apis. And this would not be much use for accessing keystrokes which are client side.

    Blazor (WASM or server) can only access keystrokes via calls to JavaScript interop to capture browser keyboard events.

    Browser low level keyboard support

    https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. satya karki 996 Reputation points MVP
    2022-12-28T11:16:41.897+00:00

    Hi,
    I think you will face error if you use your .net framework dll directly to the Blazor app. You can try first converting the .net framework project to .net standard and then use it in Blazor App.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.