- Project Types = Visual C#
- Templates = Class Library
Project Properties
- Output Type = Class Library
- Output Path = "bin\Debug\"
Compile and Build => dll file will be created in output path.
Example:
- Type the following in the Class1.cs /**********************************/
- After compile and build, MathFunctions.dll file is created in output bin. (MathFunctions.dll file name is based on Assembly name in Project Properties)
- User can then use the dll by
- Add reference the MathFunctions.dll
- Using MathFunctions;
- Then "AddClass" can now be use in the user project.
namespace MathFunctions
{
public class AddClass
{
public static int Add(int a, int b)
{
return (a + b);
}
}
}
/**********************************/
http://www.codeguru.com/csharp/csharp/cs_misc/dllsandexecutables/article.php/c4239/Creating-and-Using-C-DLLs.htm



No comments:
Post a Comment