I installed dapper from NuGet. When I try to compile the code I'm getting the error
Referenced assembly Dapper does not have a strong name
What causes this?
In Solution Explorer, open the shortcut menu for the project, and then choose Properties. Under the Build tab you'll find a Strong naming node. Select the Sign the assembly checkbox, which expands the options. Select the Browse button to choose a Strong name key file path.
To determine if an assembly is strong-typed, use the Strong Name Tool from Microsoft (http://msdn.microsoft.com/en-us/library/k5b5tt23(v=vs.71).aspx) by running the 'sn.exe -v <assembly>' command. You may need to download one of the Windows SDK packages to get access to this tool.
The benefits of strong naming are: The assembly can be referenced and used by other strong-named assemblies. The assembly can be stored in the Global Assembly Cache (GAC). The assembly can be loaded side by side with other versions of the assembly.
You see the error because the package you use doesn't have a strong name, that is it doesn't use signing.
Signing ensures the authenticity of an assembly. See Anything wrong with NOT signing a .NET assembly? for more information about the reasons assemblies should (or should not) be signed.
If an assembly is not signed, it cannot be used in an assembly which is.
You may either deactivate signing in the assembly which uses Dapper, but I wouldn't recommend that. Instead, you may use the Dapper.StrongName
package instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With