引用的程序集 Dapper 没有强名称

Referenced assembly Dapper does not have a strong name

我从 NuGet 安装了 dapper。当我尝试编译代码时出现错误

Referenced assembly Dapper does not have a strong name

这是什么原因造成的?

您看到错误是因为您使用的包没有强名称,即它不使用签名。

签名确保程序集的真实性。有关程序集应该(或不应该)签名的原因的详细信息,请参阅 Anything wrong with NOT signing a .NET assembly?

如果程序集未签名,则不能在已签名的程序集中使用。

您可以在使用 Dapper 的程序集中停用签名,但我不建议这样做。相反,您可以使用 Dapper.StrongName 包。