RobThree / TwoFactorAuth.Net

.Net library for Two Factor Authentication (TFA / 2FA)
MIT License
338 stars 59 forks source link

Referenced assembly 'TwoFactorAuth.Net.dll' does not have a strong name #21

Open Qwessie opened 2 years ago

Qwessie commented 2 years ago

I've tried to install and use this 2FA library using nuget in my solution, but I get the following error when trying any of the classes/methods:

Referenced assembly 'TwoFactorAuth.Net.dll' does not have a strong name

I've checked the dll using sn.exe and indeed it says:

TwoFactorAuth.Net.dll does not represent a strongly named assembly

I have signing turned on in my projects and I don't want to disable it, but I also don't want to have to sign library dll's myself, since it makes updating from nuget more difficult.

Can you help me with this? Thanks in advance!

RobThree commented 2 years ago

I'm not sure I see the benefits of strong naming:

For .NET Core and .NET 5+, strong-named assemblies do not provide material benefits. The runtime never validates the strong-name signature, nor does it use the strong-name for assembly binding. source

Over the past, what, 15 years I've been in both camps several times and I still can't make up my mind. Currently I see no real benefits.

Qwessie commented 2 years ago

I understand that for newer apps, that use .NET Core or .NET 5+, this might not have any benefits.

However, your library has a minimum of .NET 4.6, and our application uses 4.7.2 and does use strong naming. I cannot migrate to .NET Core or .NET 5+ in a foreseeable future, so I am now unable to use this library?