AssemblyKeyFile

suggest change

Whenever we want our assembly to install in GAC then it is must to have a strong name. For strong naming assembly we have to create a public key. To generate the .snk file.

To create a strong name key file

  1. Developers command prompt for VS2015 (with administrator Access)
  2. At the command prompt, type cd C:\Directory_Name and press ENTER.
  3. At the command prompt, type sn -k KeyFileName.snk, and then press ENTER.

once the keyFileName.snk is created at specified directory then give refernce in your project . give AssemblyKeyFileAttribute attribute the path to snk file to generate the key when we build our class library.

Properties -> AssemblyInfo.cs
[assembly: AssemblyKeyFile(@"c:\Directory_Name\KeyFileName.snk")]

Thi will create a strong name assembly after build. After creating your strong name assembly you can then install it in GAC

Happy Coding :)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


AsseblyInfo.cs examples:
* AssemblyKeyFile

Table Of Contents
17 Regex
19 Arrays
21 Enum
22 Tuples
24 GUID
27 Looping
36 Casting
46 Methods
88 Events
92 Structs
104 Indexer
106 Stream
107 Timers
109 Threading
127 Caching
135 Pointers
139 AsseblyInfo.cs examples
147 C# Script