Académique Documents
Professionnel Documents
Culture Documents
Hello! This is a short article describing how to add an assembly to the GAC.
2. Navigate to the folder where the sn.exe and the gacutil.exe are located.
This is usually the most commonly place where the mentioned tools are located, but it
can be located on another place (on a server for example). Just make sure that the
gacutil.exe and the sn.exe are located on the folder path that you specified on the
command.
3. Create a strong name for the DLL (if you have a strong name already for the
DLL, skip this step).
sn -k Folder_Path_Where_The_DLL_Is_Located\DLL_Name.snk
This will create you the .snk (strong name key) file on the location where you have
the DLL.
4. Reference the strong name on the AssemblyInfo.cs file on the project where you
created the DLL.
...
[assembly: AssemblyKeyFile(@"Strong_Name_Path")]
...
If you closed the Command Prompt window, redo step 1 and 2, and then execute this
command:
gacutil /i DLL_PATH
And that is all. If you have any questions or comments, please post it bellow or send
me an email to the address specified on the About section. God Bless!