How do I make a DLL in C#?

You need to use the /target:library compiler option.

Showing Answers 1 - 2 of 2 Answers

swag

  • Dec 26th, 2005
 

Open the property page of the Project File and then

open CommonProperties -> Genaral ->Output Type

change the output type to class library and build the application then u'll get a dll file.

also in the Configuartion Properties ->Build -> Output Path

u mention the path where u wnat to store your dll file.

There is no Issue to make dll in C#...Go to Project and Select "Class Library" and work as you work in Usual FORM by making Classes or functions ....The only difference is that when we are making any File in DLL ,The file cannot be run in Class Library.When you run the Program its give the error " The Project with an output type of class Library cannot be directly accessed". when you recieve this Warning check in the DEBUG folder that your DLL file has created...

Now again open a New Application in Console Or windows form..Add a reference by Right clicking in the Solution Explorer in the reference Menu Select the Upper option "Browse" and target your DLL file in this Dialouge..

give the namespace like that

using ClassLibrary1
now you will be able too utilize dll ...Dll is mostly used for not giving your Source Code to anyone .

Regards Ubaid Ali Jaffery

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions