How to create dll’s and classes in .Net?

How to create dll and classes in Visual Studio and How to add a dll or class to a application?

  1. To create a dll, Select Start->All Programs->Microsoft Visual Studio-> Visual Studio Tools->Visual Studio 2005 Command Prompt
  2. Get into your Projects containing folder

Eg: D:\ProjectFolder\Webservice1\WebService1>using cd command (ex: cd ProjectFolder; cd Webservice1; in cmdprompt)

  1. Then use the following command to create a class

D:\ProjectFolder\Webservice1\WebService1> wsdl /l:CS /protocol:SOAP http://localhost:1621/Service1.asmx?WSDL

(http address that you get while running your project)

  1. 4.Use the following command to create a dll

D:\ProjectFolder\Webservice1>WebService1 >csc /t:library /r:System.Web.Services.dll /r:System.Xml.dll Service1.cs

Now the class and dll will be created in the projects containing folder.

To use this dll in other projects

a. Go to Projects Menu and select Add Reference

b. Under the browse tab select the dll you created.

c. Create a object and call the methods in dll in your project.

Eg: If the dll name is Service1.dll , then

Service1 server=new Service1();

Server.HelloWorld();

Udhaya

PiSquare

Tags: , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a comment