---
title: "Strong name and gacutil command in .Net"  
description: "Strong Name is similar to GUID (It is supposed to be unique in space and time). In COM components, Strong name is only needed when we need to deploy a"  
author: "AVADHESH PATEL"  
published: 2012-07-09  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/961/strong-name-and-gacutil-command-in-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# Strong name and gacutil command in .Net

##### Strong name:

[Strong Name](https://www.mindstick.com/blog/495/strong-name-in-dot-net) is similar to GUID (It is supposed to be unique in space and time). In COM [components](https://www.mindstick.com/blog/74096/understanding-the-role-of-some-integral-ac-components), Strong name is only needed when we need to deploy assembly in GAC. Strong names help GAC to differentiate between [two versions](https://www.mindstick.com/interview/34125/how-do-you-compare-last-modified-time-between-two-versions-of-a-file). Strong names use public key [cryptography](https://www.mindstick.com/articles/333343/exploring-quantum-cryptography-and-next-gen-defense-mechanisms) (PKC) to ensure that no one can spoof it. PKC use public key and private key concept. Following are the step to generate a strong name and sign an assembly:

##### gacutil command:

The [Global Assembly](https://www.mindstick.com/forum/158850/what-is-the-purpose-of-the-global-assembly-cache-gac-in-dot-net-core) Cache tool [allows you to view](https://answers.mindstick.com/qa/33729/which-report-allows-you-to-view-performance-data-for-search-queries-that-triggered-your-ad-and-received-clicks-in-adwords) and manipulate the contents of the global assembly cache and download cache.

Gacutil.exe is considered to be a [development](https://yourviews.mindstick.com/view/83465/china-s-development-near-indian-border-and-how-it-is-a-threat-to-india) tool. Because of this it is only contained in the .NET SDK but not in the regular redistributable. [Visual Studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) comes with the SDK, so all Visual Studio users have it installed.

##### Using strong name and gacutil command:

Step1:Go to “[Microsoft](https://yourviews.mindstick.com/view/81711/microsoft-disconnects-cortana-and-reinvents-it) Visual Studio 2010” >>Visual Studio Tool>> Visual Studio [Command prompt](https://answers.mindstick.com/qa/51716/how-to-make-bootable-pendrive-using-cmd-windows-command-prompt). This wills popup the command prompt for you.

![Strong name and gacutil command in .Net](https://www.mindstick.com/mindstickarticle/9a3fb860-8c87-4ad9-98ed-3b594018c101/images/890b231c-6e2f-401b-95cf-e716bb03b5d6.png)

Step2: After the command prompt run the strong tool from there

D:\>cd avi

D:\avi>sn –k key.snk

Here k: the key specifies that we want to generate the key.

key.snk: This file contains the key that is generated by the sn tool

![Strong name and gacutil command in .Net](https://www.mindstick.com/mindstickarticle/9a3fb860-8c87-4ad9-98ed-3b594018c101/images/c6edd937-31da-49a0-8683-c877535e3d56.png)

Note- Microsoft use symmetric algorithm, RSA2

Step3: Attached the key

```
using System;using System.Reflection;[assembly:AssemblyKeyFile("key.snk")]public class show{    public
string show_employee()    {        return
"Hello...";    }}
```

Write above code on notepad and save it, where key.snk saved. Then make DLL like

![Strong name and gacutil command in .Net](https://www.mindstick.com/mindstickarticle/9a3fb860-8c87-4ad9-98ed-3b594018c101/images/26bfebf3-8967-4e4a-9639-7ed1c5fc14af.png)

Step4:Mapped DLL in Assembly folder

![Strong name and gacutil command in .Net](https://www.mindstick.com/mindstickarticle/9a3fb860-8c87-4ad9-98ed-3b594018c101/images/c5f54f49-2300-44ba-bcb4-ad60fc354df4.png)

Step5: Write code on notepad and make EXE file in different folder and access show.dll file

```
using System;public class check{    public static void Main()    {       show s = new show();       Console.WriteLine(s.show_employee());    }}
```

![Strong name and gacutil command in .Net](https://www.mindstick.com/mindstickarticle/9a3fb860-8c87-4ad9-98ed-3b594018c101/images/a3805ab4-bf45-4b14-a57a-af62e07aadc3.png)

Step6: execute check exe….

![Strong name and gacutil command in .Net](https://www.mindstick.com/mindstickarticle/9a3fb860-8c87-4ad9-98ed-3b594018c101/images/e3001842-789e-46df-b6d8-677c8545a110.png)

---

Original Source: https://www.mindstick.com/articles/961/strong-name-and-gacutil-command-in-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
