XCopy Deployment

If you have been an MS-DOS person, you will surely remember the XCopy command. It allowed copying entire directory trees, including files and subdirectories, from one location to another. In honor of this command, the most basic deployment technique in the .NET Framework is XCopy deployment. The reason for this name is that a .NET application can work when the executable and the assemblies referenced by such executable all reside in the same folder. According to this, you can deploy an application by simply copying its folder. This approach has a huge implication: Because an application folder contains a copy of required assemblies, these are isolated from one another and do not require registration anymore. Because they are no longer required to be registered, multiple versions of an assembly can reside on the same machine avoiding the big problem of the Dll hell.

Base Class Library Assemblies

Of course the preceding discussion is not valid when talking about the Base Class Library assemblies, being part of the .NET Framework, and that thus cannot be included in the application folder. They instead stay in the GAC as covered in next section.

When you compile your project, Visual Studio generates a Bin subfolder within the project folder. Bin contains Debug and Release subfolders (referring to default build configurations). Both folders contain the executable and referenced assemblies. Basically you can perform an XCopy deployment simply by distributing the content of the Release folder, and your application will work. XCopy deployment is something that you have to know to understand how things work, but obviously in a business environment, you will deploy your applications with professional installers, such as Windows Installer and ClickOnce that are discussed in the next two chapters. Another consideration about XCopy deployment is that in this way every application keeps its own copy of referenced assemblies. This means that if you have ten applications referring to the same assembly, you will have ten copies of the assembly. This is good in that assemblies will not interfere with each other, especially in the case of different versions. But if you have ten copies of the same version of your assembly, this can be annoying. A solution to this issue is provided by the Global Assembly Cache that also solves other problems, which is the subject of next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.31.26