Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attempt to install an assembly without a strong name

Tags:

c#

.net

gac

I added post-build command line in my project:

"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" /if "$(TargetFileName)"

But I got error:

The command exited with the code 1.

In output:

Failure adding assembly to the cache: Attempt to install an assembly without а strong name

How can I solve this problem?

like image 580
Kirill Avatar asked Oct 19 '25 07:10

Kirill


1 Answers

There are really only two options here, don't place the assembly in the GAC or sign the assembly before putting it into the GAC.


The assembly needs to be signed in order to be stored in the GAC.

"Assemblies deployed in the Global Assembly Cache must have a strong name." MSDN - Global Assembly Cache

If you need help signing an assembly with a strong name follow this article. MSDN - How to sign an assembly


Here are some related links:

Cannot install assembly to cache? <-- The current post is really a duplicate of this.

Signing assemblies - basics

C#: why sign an assembly?

How to register a non-strong-name assembly to be loaded as if it were in the GAC?

like image 79
580 Avatar answered Oct 21 '25 20:10

580



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!