June 2, 2007, 11:04 a.m.
posted by fractal
IntroductionAssemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows services, serviced components, and .NET remoting applications. The .NET applications use two different types of assemblies: private assemblies and shared assemblies. Private assemblies are identified by their names and are deployed for the use of only a single application. Shared assemblies are identified by a strong name and are deployed for use by multiple applications. A strong name uses four attributes to identify an assembly: name of the assembly, version number, culture identity, and a public key token. An assembly may also refer to the classes present in other assemblies. When an assembly is built, information about all other assemblies to which it refers is stored in the assembly manifest. The manifest, however, does not store the assembly's exact path because this path may differ on the computer where the assembly is deployed. At runtime when a class is referenced, the CLR reads the assembly manifest, retrieves the identification information for the referenced assembly, and then attempts to locate the referenced assembly. The mechanism used by the CLR to locate a private assembly is different from that of a shared assembly. The set of rules that the CLR uses to locate an assembly is called binding policy. Binding policy is a deciding factor in how and where an application's assemblies should be deployed. In a successfully deployed application, the CLR should be able to bind to all the referenced assemblies. In other words, for a successful deployment you need to deploy your assemblies at a location where the CLR expects to find them. In the first part of this chapter, you will learn how to work with private and shared assemblies and how to deploy them successfully. After you have identified the assemblies that need to be deployed, and identified where the assemblies need to be deployed, you need to find an effective way to package and distribute your application. That's what you'll study in the later part of this chapter. You will learn how to deploy a Web service, a Windows service, a serviced component, and a .NET remoting object. The .NET Framework greatly simplifies various deployment tasks. In fact, just copying the files on the target computer can easily deploy some simple applications. For advanced deployment options and requirements, however, you may want to create a Windows Installer–based setup project. In this chapter, you'll also learn how to use Visual Studio .NET setup and deployment projects to create Windows Installer–based setup packages for deploying the given applications. |
- Comment