Loading...

How to make a shared Library and adding Assembly to Global Assembly

Making a shared Library in Using Command Prompt and adding assembly to Global Assembly Cache:

We have learnt How to Use a DLL in C# already. Now we will learn to make a share dll.
The whole Procedure is given in Steps below:

  • First of all go to Command Prompt to make Strong Name.

  • Write command "sn -k  [name].snk, for example I am writing "sn -k  faisal.snk"

  • Now make a dll as instructed in  Use a DLL in C#, after making now go to properties of it and click on Signing.

  • Check the option "Sign the Assembly" and Choose a strong name using Browse.
  • Go on the directory where you made the Strong name and select that strong name, We have made it by default at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC.

  • Now build the solution. (It is a Library and will not be executed)
  • Go to debug of your Project, a dll will be made.
  • To make it Shared again go to Command Prompt
  • Goto the Directory of Debug of your dll by copying its address and pasting it on command prompt.



  • Now Write Command "gacutil/i [dll name].dll" as we write gacutil/i ClassLibrary2.dll




Uninstall a dll using Gacutil:

To uninstall simply write command  "gacutil/u [dll name]" like gacutil/u ClassLibrary2


Thanks For Reading, Like this if you understood, It helps a lot to keep us motivated

Google+

 
TOP