How to create dll and classes in Visual Studio and How to add a dll or class to a application?
- To create a dll, Select Start->All Programs->Microsoft Visual Studio-> Visual Studio Tools->Visual Studio 2005 Command Prompt
- Get into your Projects containing folder
Eg: D:\ProjectFolder\Webservice1\WebService1>using cd command (ex: cd ProjectFolder; cd Webservice1; in cmdprompt)
- 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)
- 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();
Tags: .Net, c#, call, class, command, create, Creating Class in .net, dll, folder, hello world, How to create classes, How to create dll, How to create dll in .net?, methods, Microsoft Visual Studio, objects, pisquare, project, project menu, reference, udhaya, visual studio, Visual Studio 2005 Command Prompt, Visual Studio Tools, WebService, webservices
Leave a comment