Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 27 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
27
Dung lượng
379,85 KB
Nội dung
CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 9 Deployment CERTIFICATION OBJECTIVES 9.01 Deploying a .NET Remoting Object 9.02 Deploying an XML Web Service 9.03 Publishing XML Web Service Definitions in the UDDI 9.04 Registering Components and Assemblies ✓ Two-Minute Drill Q&A Self Test P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:36 AM Color profile: Generic CMYK printer profile Composite Default screen 2 Chapter 9: Deployment CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 T he last task in any software project is to deploy the application to the production environment—server or client computer. Deployment can be as easy as copying the application to the target computer or can involve building an installation application that takes care of all the details. In this chapter, you will learn how to deploy a .NET Remoting Object and an XML Web Service. The deployment of a Windows service was handled in Chapter 2, and serviced components were covered in Chapter 3. CERTIFICATION OBJECTIVE 9.01 Deploying a .NET Remoting Object In order to deploy a .NET Remoting object, you need to add an installation project to the solution. Installation projects produce as their output a Windows Installer file that has the .msi extension. Microsoft Windows Installer is an installation and configuration service that ships as a part of Windows 2000, Windows Me, and Windows XP. Windows Installer is based on a model that provides all installation data and instructions in a single package. Traditional scripted setup programs focused on how to install an application—Windows Installer focuses on what to install. Windows Installer keeps track of what has been installed and verifies that no software component is uninstalled if there are any applications that rely on the component. The data that is kept on each computer includes Registry keys and dependencies. Windows Installer also supports self-repair—the ability for an application to automatically reinstall missing files that may have inadvertently been deleted by the user. The Setup and Deployment projects add support for Windows Installer to a solution. P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:36 AM Color profile: Generic CMYK printer profile Composite Default screen Deploying a .NET Remoting Object 3 CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 Windows Installer is the base that the deployment tools in Visual Studio .NET are built on—providing a comprehensive set of tools that you can use to manage the deployment and maintenance of your applications. EXERCISE 9-1 Deploying a .NET Remoting Object In this exercise, you will deploy a .NET Remoting object. The remoting object is the HelloAgain project you built in Chapter 4. The HelloAgain solution is available on the accompanying CD in the Chapter 9 directory. 1. Copy the HelloAgain solution from the CD to the C:\VB directory. 2. Navigate to the C:\VB\HelloAgain directory. 3. Double-click the HelloAgain.sln solution file to open the project in Visual Studio. NET. The result should look like this: 4. Right-click the HelloAgain solution in Solution Explorer. Select Add | New Project from the context menu. P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:36 AM Color profile: Generic CMYK printer profile Composite Default screen 4 Chapter 9: Deployment CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 5. Add a new Setup and Deployment project based on the Setup project template. Name the project HelloSetup. The resulting solution is shown next: P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:36 AM Color profile: Generic CMYK printer profile Composite Default screen Deploying a .NET Remoting Object 5 CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 6. Add the HelloAgain project output to the Setup project by right-clicking Application Folder in the File System window. Select Add | Project Output from the context menu. This step will identify the application (either .exe or .dll) files that will be deployed with the setup application. 7. Change the Configuration to be Release .NET and select Primary Output. 8. Click OK to add the Project output. P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:36 AM Color profile: Generic CMYK printer profile Composite Default screen 6 Chapter 9: Deployment CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 9. Ensure that both projects are set to release builds. The solution should look this: 10. Right-click the HelloAgain project in Solution Explorer and select Rebuild from the context menu to build the release version of the HelloAgain application. 11. Right-click the HelloSetup project in Solution Explorer and select Rebuild from the context menu to build the setup application. 12. Open My Computer and navigate to the C:\VB\HelloSetup\Release directory to verify the output from the build. The directory should look like this: P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:36 AM Color profile: Generic CMYK printer profile Composite Default screen Deploying a .NET Remoting Object 7 CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 The directory contains the Windows Installer HelloSetup.msi file as well as the traditional installation file Setup.exe with its Setup.ini configuration file. EXERCISE 9-2 Installing a .NET Remoting Object In this exercise, you will install the .NET Remoting object from the HelloSetup project. 1. Open My Computer and navigate to the C:\VB\HelloSetup\Release directory. 2. Double-click HelloSetup.msi to start the installation. The result is the HelloSetup Setup Wizard. P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:36 AM Color profile: Generic CMYK printer profile Composite Default screen 8 Chapter 9: Deployment CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 3. Click Next to select the installation folder and verify the location. This dialog box also enables you to select how the application will be registered—as part of the profile of all users, or only for the current user. 4. Click Next to see the Confirm Installation dialog. 5. Click Next to start the installation. 6. Click Close to exit the successful installation. EXERCISE 9-3 Uninstalling a .NET Remoting Object Applications that are installed using the Windows Installer are uninstalled from the Control Panel, Add/Remove Programs application. P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:37 AM Color profile: Generic CMYK printer profile Composite Default screen Deploying a .NET Remoting Object 9 CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 1. Open the Control Panel by choosing Start | Settings | Control Panel. 2. Double-click Add/Remove Programs to open the Add/Remove Programs application. 3. Select the HelloSetup application and click Remove. 4. Click Yes to verify that you want to remove the application. 5. The HelloSetup application is removed. 6. Close the Add/Remove Programs application. Use Windows Installer applications to be able to uninstall the application through the Add/Remove Programs application. P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:37 AM Color profile: Generic CMYK printer profile Composite Default screen CERTIFICATION OBJECTIVE 9.02 Deploying an XML Web Service XML Web Services are deployed to a production server either by using XCOPY deployment or by adding a Web Setup project to the solution. You will step through the deployment of a web service in the following exercises. EXERCISE 9-4 Deploying a Web Service You will start this exercise by creating a simple XML web service that you will name HiHo. 1. Create a new Visual Basic .NET project based on the ASP Web Service template. Name the project HiHo. CertPrs8 / MCAD/MCSD XML Web Services and Server Components Development with Visual Basic .NET / Lind / 222653-6 / Chapter 9 10 Chapter 9: Deployment P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:37 AM Color profile: Generic CMYK printer profile Composite Default screen [...]... Visual Basic NET / Lind / 222653-6 / Chapter 9 Registering Components and Assemblies 21 CERTIFICATION SUMMARY In this chapter, you explored deployment of NET Framework applications using the Setup and Deployment projects that are added to any solution Setup and Deployment projects are built on the Windows Installer, which provides a very strong base for installation services—including reference counting,... Services and Server Components Development with Visual Basic NET / Lind / 222653-6 / Chapter 9 Deployment TWO-MINUTE DRILL Deploying a NET Remoting Object Use a Setup and Deployment project to deploy a NET Remoting object ❑ Add only the primary output to the project output Deploying an XML Web Service Use a Setup and Deployment project to deploy an XML web service ❑ Add only the primary output and content... ABC Deployment Service Overview P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:38 AM Color profile: Generic CMYK printer profile CertPrs8 Composite Default screen / MCAD/MCSD XML 18 Chapter 9: Web Services and Server Components Development with Visual Basic NET / Lind / 222653-6 / Chapter 9 Deployment http://www.abc.abc/business/overview.aspx... to register a tModel: ABC tModel A tModel for the ABC Deployment Service The ABC Deployment Service tModel http://www.abc.abc/business/overview.aspx Business entities can... dialog, select a Setup and Deployment project based on the Web Setup Project template—name the project HoHo P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:37 AM Color profile: Generic CMYK printer profile CertPrs8 Composite Default screen / MCAD/MCSD XML 12 Chapter 9: Web Services and Server Components Development with Visual Basic NET / Lind / 222653-6 / Chapter 9 Deployment 9 Click OK... business that registers with UDDI The following XML document shows how that can be done: ABC Deployments The ABC Deployment Service Web Master P:\010Comp\CertPrs8\653-6\ch09.vp Wednesday, October 30, 2002 9:49:38 AM Color... object that will be hosted by IIS? A Copy the files to a new folder on the server B Use the gacutil.exe utility to install the NET Remoting object C Add a Setup and Deployment project to the solution, based on a Setup project D Add a Setup and Deployment project to the solution, based on a Web Setup project Deploying an XML Web Service 2 You have successfully deployed an XML Web Service to a test server... profile: Generic CMYK printer profile CertPrs8 Composite Default screen / MCAD/MCSD XML 20 Chapter 9: Web Services and Server Components Development with Visual Basic NET / Lind / 222653-6 / Chapter 9 Deployment No version checks take place if the assembly is not signed with a strong name Assemblies that are to be installed in the GAC must have strong names Remember the order that an application uses... provides reference counting among other features Check out the common scenarios & solutions sidebar I have provided—they might come in handy during the exam SCENARIO & SOLUTION Why should I use a Setup and Deployment project to deploy a NET Remoting object? You would use the Windows Installer to make sure that there is instance counting for the NET Remoting object, and that the IIS virtual directory is configured... probably not use UDDI (primarily because there is no private solution yet) and you would probably look at setting up a static discovery system Why do I need to include content files in XML Web Service deployment projects? The entry point to the XML Web Service is through a content file (.asmx) The default Primary Output does not include any files that are text based In order to use the service, you . base that the deployment tools in Visual Studio .NET are built on—providing a comprehensive set of tools that you can use to manage the deployment and. production server either by using XCOPY deployment or by adding a Web Setup project to the solution. You will step through the deployment of a web service in the