asp net 3.5unleashed

Page 102

As an application runs, the CLR maintains a “snapshot” of the set of assemblies loaded by the application. When the application terminates, this information is compared with the information in the application’s corresponding .ini file. If the application loaded the same set of assemblies that it loaded previously, the information in the .ini file matches the information in memory and the in-memory information is discarded. If on the other hand the in-memory information differs from the information in the .ini file, the CLR appends the in-memory information to the .ini file. By default, the .ini file is able to store up to five snapshots. Basically, the CLR is keeping a record of the assemblies that an application used. Now, let’s say that you install some new assemblies and maybe some new publisher policy assembly gets installed too. A week later, you run an application and all of a sudden, the application isn’t performing correctly. What can you do? Historically, in Windows, the best thing to do would be to reinstall the failing application and hope that the reinstall doesn’t break some other application (which would be likely). Fortunately for the end-user, the CLR keeps a historical record of the assemblies that an application uses. All you have to do is build an XML configuration file for the application where the elements tell the CLR to use the same assemblies that were loaded when the application was in a last-known good state. To make creating or modifying an application configuration file easy, you can use the .NET Framework Configuration tool. Run the tool, right-click on the Application node in the tree pane, and select the Fix An Application menu item. This causes the dialog box in Figure 310 to appear.

Figure 3-10 : .NET Application Configuration tool showing all applications that have had assembly load information recorded at one time or another Note The .NET Framework Configuration tool is a Microsoft Management Console (MMC) snap-in and, therefore, isn’t installed on Windows 98, Windows 98 Standard Edition, or Windows Me. However, on these operating systems, you can use the .NET Framework Wizards utility to do what I describe in this section. You can invoke this tool from the Start menu by clicking Program Files, then Administrative Tools, and then .NET Framework Wizards. The dialog box in Figure 3-10 shows the applications about which the CLR has accumulated assembly load information. Basically, an entry appears here for every .ini file in the


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.