Steps to create Shared assembly

  1. Create a new Class library file from .Net IDE.
  2. Write the required code.
  3. Compile the class library. It will produce a .dll at bin\debug\ folder which is called as an assembly.
  4. In order to register an assembly with in a GAC, it is mandatory that the assembly should define with the strong name.

    To do, in the .Net Command prompt

    ..\>sn –k <filename>.snk

  5. In IDE, through Solution Explorer ,open AssemblyInfo.cs and change [assembly: AssemblyVersion("1.0.*")] to [assembly: AssemblyVersion("1.0.0.0")]
  6. Also, change [assembly: AssemblyKeyFile] to [assembly: AssemblyKeyFile(@"<strongNameFilePath>)]
  7. Open a the class library file and write the required code, then rebuild the project.
  8. Then register the assembly definition within GAC using gacutil command at .Net command prompt.

    ..\>gacutil –i <dll_file_path>

  9. Verify at C:\Windows\Assembly, an entry of new dll exists.

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger