Steps to create a public assembly
1) Create a new project of class library.
2) Write your methods in a class.
Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MathClass
{
public class SampleClass
{
public int Add(int a, int b)
{
try
{
return a + b;
}
catch (Exception objEx)
{
throw objEx;
}
}
public int Subtraction(int a, int b)
{
try{
return a-b;
}
catch (Exception objEx)
{
throw objEx;
}
}
}
}
3) Build class library
4) create strong key pair using following line
c:\sn.exe -k myKey.snk 5) Sign assembly by browsing your created key pair.
Right click on your project->Properties->Signing->sign the assembly
6) Rebuild your class library
7) Install assembly using gacutil:
Open Visual Stuadio Command Prompt
gacutil -i "<dllname with path>" Public assembly created.
Now you can use assembly by add reference in your project.