Deployment


Assemblies with serviced components must be configured with COM+. This configuration can be done automatically or by registering the assembly manually.

Automatic Deployment

If a .NET client application that uses the serviced component is started, the COM+ application is configured automatically. This is true for all classes that are derived from the class ServicedComponent. Application and class attributes such as [EventTrackingEnabled] define the characteristics of the configuration.

Automatic deployment has an important drawback. For automatic deployment to work, the client application needs administrative rights. If the client application that invokes the serviced component is ASP.NET, the ASP.NET runtime usually doesn’t have administrative rights. With this drawback, automatic deployment is useful only during development time. However, during development, automatic deployment is an extremely advantageous feature because it is not necessary to do manual deployment after every build.

Manual Deployment

You can deploy the assembly manually with the command-line utility .NET Services installation tool regsvcs.exe. Starting the command

 regsvcs SimpleServer.dll 

registers the assembly SimpleServer as a COM+ application and configures the included components according to their attributes; it also creates a type library that can be used by COM clients accessing the .NET component.

After you’ve configured the assembly, you can start the Component Services Explorer by selecting Administrative Tools image from book Component Services from the Windows menu on Windows XP or Windows Server 2003. On Windows Vista you have to start the MMC and add the Component Services snap-in to see the Component Services Explorer. In the left tree view of this application, you can select Component Services image from book Computers image from book My Computer image from book COM+ Applications to verify that the application was configured.

Creating an Installer Package

With the Component Services Explorer, you can create Windows installer packages for server or client systems. An installer package for the server includes the assemblies and configuration settings to install the application on a different server. If the serviced component is invoked from applications running on different systems, a proxy must be installed on the client system. The installer package for the client includes assemblies and configuration for proxies.

To create an installer package, you can start the Component Services Explorer, select the COM+ application, select the menu options Action image from book Export, and click the Next button in the first dialog. The dialog shown in Figure 38-3 opens. In this dialog, you can export either a Server application or an application proxy. With the option Server application you can also configure to export user identities with roles. This option should only be selected if the target system is in the same domain as the system where the package is created, as the configured user identities are put into the installer package. With the option application proxy, an installer package for the client system is created.

image from book
Figure 38-3

Tip 

The option to create an application proxy is not available if the application is configured as a library application.

To install the proxy, you just have to start the setup.exe from the installer package. Be aware that an application proxy cannot be installed on the same system where the application is installed. After installation of the application proxy, you can see an entry in Component Services Explorer that represents the application proxy. With the application proxy the only option that can be configured is the name of the server in the Activation tab as discussed in the next section.




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

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