Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referenced assembly Dapper does not have a strong name

Tags:

nuget

dapper

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?

like image 768
Dharani thulasi Avatar asked Apr 04 '16 07:04

Dharani thulasi


People also ask

How do I strong my assembly name?

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.

How do you tell if an assembly is strongly named?

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.

Why a strongly named assembly is required?

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.


1 Answers

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.

like image 65
Arseni Mourzenko Avatar answered Oct 09 '22 09:10

Arseni Mourzenko