Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
How to make and use a dll in C#..
Posted

To create a DLL you need to create a class library project in c# which once compiled will create the DLL.

To use the DLL you just need to add a reference to the DLL in your project

Links

http://msdn.microsoft.com/en-us/library/3707x96z%28v=vs.80%29.aspx[^]

http://stackoverflow.com/questions/9830127/referencing-a-dll-in-c-sharp[^]

http://msdn.microsoft.com/en-us/library/wkze6zky%28v=vs.80%29.aspx[^]
 
Share this answer
 
Right click your solution in the Solution Explorer pane, and select "Add..."..."New Project"
In the dialog that appears, Select C# as the language on the left, then "Class Library" on the right.
Change the "Name" at the bottom to something that describes what the DLL is to contain: "VideoControls" or "ImageSlideShow" perhaps.
Press Ok.
A new project will have been added to your solution.
If you want to access it from your other projects in the same solution, then right click "References" under each project name, and select "Add Reference".
In the dialog that appears, select "projects" on the left hand side, highlight your DLL name on the right, and press "Add". The close the dialog.

To use it in external projects, build it for release and add it as a reference in the normal way, browsing to the release version of the DLL.
 
Share this answer
 
open new project as class library, type code and build it.

it will make reusable .dll file for you.
another way if you have written code in windows based application, go to solution explorer select your application right click it and select property,

you will see the output type you can change it to class library,
remember to build only, if you try to debug it it will throw an error!


After successfully creating a .dll file you can use it to another application by:
right click your application on solution explorer, select Add reference and browse where the .dll is allocated..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900