When you have finished testing and debugging your Web Service you are ready to compile and deploy it. Open the Configuration Manager for the Web Service and change the configuration from Debug to Release. Rebuild the Web Service.
If you leave the Configuration Manager configured to Debug when you build, a .pdb debug file is created and symbolic information remains in your Web Service. This extra overhead may make your Web Service a bit sluggish .
Visual Studio .NET saves all files before compiling. During compilation the .asmx, .vb, and global.asax files are compiled into the Web Service DLL. For example, our dice example is compiled into Dice.dll.
To deploy the application, you can add a Web Setup Project from the Add New Project dialog box, or you can simply copy the necessary files to the target Web server. (If the development server is the target Web server, you are finished.)
The ability to copy a Web Service is a matter of copying the folder containing the project files to your Web server's root directory, or if you want to get just the minimum files then use the Project, Copy Project menu. To deploy a Web Service using the Copy Project menu item, follow these steps (use Figure 18.11 as a guide):
Choose View, Solution Explorer to open the Solution Explorer view.
Click on the Web Service project.
Choose the Project, Copy Project menu.
In the Copy Project dialog box, specify the target Web server, the Web access method, and the Copy mode. (Select the option labeled Only Files Needed to Run This Application unless you have a specific reason for choosing one of the other options.)
Figure 18.11. Use the Copy Project dialog box to deploy a Web Service.
When you have completed step 5, the Web Service will be copied to the Bin folder in the Web directory and the web.config, .asmx, and global.asax files will be copied to your root folder. If you want the Web Service copied to a subfolder, specify the subfolder in the Copy Project dialog box.
That is all there is to it. Copy deployment is significantly easier than registering COM DLLs and coping with "DLL Hell." Your team or your customers are ready to begin using your Web Service.