How to Deploy Web Services in Managed Code
When you compile the project, the following occurs:
Visual Studio 2008
When using Visual Studio .NET to create Web services in managed code, you use a standard deployment model: you compile your project and then you deploy the resulting files to a production server. The project .dll file contains the Web services code-behind class file (.asmx.vb or .asmx.cs) along with all other class files included in your project, but not the .asmx file itself. You then deploy this single project .dll file to the production server without any source code. When the Web service receives a request, the project .dll file is loaded and executed.
Suppose you have a simple ASP.NET Web Service project named WebService1 that contains the following:
- A Web service entry page named Service.asmx.
- A code file named Service.vb (or .cs).
- Visual Studio saves all of the files in the project you modified since the last build.
- Visual Studio copies the Service1.asmx file and the default project files to the development Web server.
- The Service.vb (or .cs) class file and the Global.asax class file are compiled into the project .dll file, which is then copied to the server in the default \bin directory of the target virtual directory. If the project is set to compile a debug version, Visual Studio creates a project .pdb file in the \bin directory.
To deploy the Web service by copying the project
- In Solution Explorer, select the project you want to copy.
- On the Website menu, click Copy Web Site.
- Click the icon next to the Connect to: dropdown box to open the Open Web Site dialog box.
- In the Open Web Site box, select the location to which you want to copy the project.
- Using the arrow icons, select files from the source web site to copy to the remote web site.
- Click Copy Web Site to copy the web site.
No comments:
Post a Comment