MediatedCommunications / WindowsInput

Capture and Simulate Keyboard and Mouse Input
MIT License
111 stars 17 forks source link

Unsigned assembly #20

Closed handerss-spotfire closed 1 year ago

handerss-spotfire commented 2 years ago

First of all, awesome library!

I have a request for signing the WindowsInput.dll. Right now when trying to use this in a project which is signed you get the following error:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  ----> Could not load file or assembly 'WindowsInput, Version=6.4.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
TonyValenti commented 2 years ago

Thanks so much! Do you know how to sign it? What version of .net are you using?

handerss-spotfire commented 2 years ago

There are various resources by Microsoft on how to sign your assembly. E.g: https://docs.microsoft.com/en-us/dotnet/standard/assembly/sign-strong-name https://docs.microsoft.com/en-us/windows/win32/sbscs/assembly-signing-example

Having a signed assembly will allow consumers of your library to keep track of the PublicKeyToken across versions and notice if anyone has tampered with it.

I used the latest .NET Framework but it shouldn't matter what version is used as long as the calling assembly is signed.

TonyValenti commented 2 years ago

Can you create a pull request that enables that? I did a little bit of googling and it seems like Strong naming is specific to.net framework and doesn't really matter for.net 5.0 or.net 6.0 applications.

handerss-spotfire commented 2 years ago

I don't think strong naming is specific to .NET Framework.

The point of it is to make sure the dll hasn't been tampered with. It's not something I can enable in a PR since it requires you (the maintainer) to create a private key and sign the dll before publishing to NuGet.