4

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Kirill
  • 429
  • 1
  • 6
  • 18

1 Answers1

4

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?

580
  • 470
  • 2
  • 12