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