Deploying a .NET Remoting Object

   


A .NET remoting object is generally deployed with the server application that uses it. This server application can be created as a console application, a Windows application, a Windows service, or a Web application. Based on what you have studied so far, the process of deploying a .NET remoting object is very similar. I'll take most of the space in this section to demonstrate how to create and use a merge module.

Components, such as serviced components and .NET remoting objects, can be shared between multiple applications. You might want to distribute these components to be used by other developers as part of their applications. The process of packaging a component for reuse in other applications is different from packaging a Windows application for deployment.

When you have a component that will be shared among multiple applications, you should package it as a merge module ( .msm file). A merge module includes the actual component, such as a .dll file, along with any related setup logic, such as resources, Registry entries, custom actions, and launch conditions.

Merge modules cannot be directly installed. They need to be merged with the installation program of an application that uses the shared component, packaged into a merge module.

When you modify a component to release new versions, you create a new merge module for each of the new versions. A new merge module should be created for each successive version of a component in order to avoid version conflicts.

In this section, I'll package a remoting object that I created in Chapter 3, ".NET Remoting," as a merge module. Before proceeding further, you should complete all the Step by Step exercises of Chapter 3 if you have not done so already.

STEP BY STEP

10.21 Creating a Merge Module Project for the DbConnect Remoting Object

  1. Add the existing remoting object projects StepByStep3-9 (the IDBConnect class created in Chapter 3) and StepByStep3-10 (the DbConnect class created in Chapter 3) to the solution.

  2. Add a new project to the solution. In the Add New Project dialog box, select Setup and Deployment Projects from the Project Types tree and select Merge Module Project from the list of templates on the right. Name the project DbConnectMergeModule . Set the configuration of the new project to the Release configuration.

  3. In Solution Explorer, right-click the project and select Add, Project Output from the context menu. In the Add Project Output Group dialog box, select StepByStep3_10 as the project and select Primary Output from the list box. Click OK.

  4. Build the DbConnectMergeModule project. Open Windows Explorer and navigate to the Release folder inside the project folder. Notice that the merge module DbConnectMergeModule.msm has been created.

In Step by Step 10.21, you created a simple Merge Module Project to package the Dbconnect remoting object. You can customize the merge module project just like any setup project discussed earlier in the chapter by using the File System Editor, Registry Editor, File Types Editor, and Custom Actions Editor.

If you later want to distribute the DbConnect remoting object with a remoting server application or any other application, you can just add the merge module created in Step by Step 10.21 to your application's setup project. Step by Step 10.22 shows you how to create a Web Setup project that includes the merge module project for installing the DbConnect remoting component.

STEP BY STEP

10.22 Creating a Web Setup Project That Uses a Merge Module for Installing the DbConnect Remoting Object

  1. Add the existing remoting server project StepByStep3_17 (provides hosting in IIS, created in Chapter 3) to the solution. Because it's an IIS solution, you'll find it under your InetPub\ wwwroot folder.

  2. Add a new project to the solution. In the Add New Project dialog box, select Setup and Deployment Projects from the Project Types tree and select Setup Wizard from the list of templates on the right. Name the project DbConnectServerSetup .

  3. In the Welcome screen of the wizard, click Next. In the Choose a Project Type screen of the wizard, choose Create a Setup for a Web application from the first group of options. Click Next.

  4. In the Choose Project Outputs to Include screen of the wizard, select Primary Output from StepByStep3_17 , Content Files from StepByStep3_17 , and Merge Module from DbConnectMergeModule, as shown in Figure 10.41. Click Next and then Next, Finish.

    Figure 10.41. Merge module is added to a setup project for deployment.

  5. Select the setup project DbConnectServerSetup in Solution Explorer. Activate the Properties window. Set Manufacturer to DbConnect Corp , ProductName to DbConnect Server , and Title to DbConnect Remoting Server Installer .

  6. Open the File System Editor for the DbConnectServerSetup Project. Change the VirtualDirectory project of the Web Application Folder to DbConnectServer .

  7. Build the DbConnectServerSetup project. Install the project. The remoting object is now available at http://localhost/DbConnectServer/DbConnect.rem .

You will, of course, need a .NET remoting client to access the URL in the preceding exercise. For more details on this, refer to Chapter 3.

REVIEW BREAK

  • To deploy a serviced component, you must register the component with the COM+ catalog and should install the component in the GAC.

  • How you deploy a .NET remoting object depends mostly on the application that uses it: Remoting configuration is all stored in XML configuration files; therefore, no extra registration steps are required.

  • When you have a component that will be shared among multiple applications, you should package it as a merge module ( .msm file). Merge modules cannot be directly installed. They need to be merged with the installation program of an application that uses the shared component, packaged into a merge module.


   
Top


MCAD. MCSD Training Guide (Exam 70-310. Developing XML Web Services and Server Components with Visual Basic. NET and the. NET Framework)
MCAD/MCSD Training Guide (70-310): Developing XML Web Services and Server Components with Visual Basic(R) .NET and the .NET Framework
ISBN: 0789728206
EAN: 2147483647
Year: 2002
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net