- Create a new Class library file from .Net IDE.
- Write the required code.
- Compile the class library. It will produce a .dll at bin\debug\ folder which is called as an assembly.
- 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
- In IDE, through Solution Explorer ,open AssemblyInfo.cs and change [assembly: AssemblyVersion("1.0.*")] to [assembly: AssemblyVersion("1.0.0.0")]
- Also, change [assembly: AssemblyKeyFile] to [assembly: AssemblyKeyFile(@"<strongNameFilePath>)]
- Open a the class library file and write the required code, then rebuild the project.
- Then register the assembly definition within GAC using gacutil command at .Net command prompt.
..\>gacutil –i <dll_file_path>
- Verify at C:\Windows\Assembly, an entry of new dll exists.
Steps to create Shared assembly
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment